address code review for startup info

JS masterUri fix, HA check cleanups, removing unneeded classes, and catch 
catalog error


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/commit/7680018f
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/tree/7680018f
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-ui/diff/7680018f

Branch: refs/heads/0.7.0-incubating
Commit: 7680018fb3cd573d6df56b62cb53da46e19f24ba
Parents: b06aa95
Author: Alex Heneveld <[email protected]>
Authored: Wed May 6 10:48:16 2015 +0100
Committer: Alex Heneveld <[email protected]>
Committed: Wed May 6 10:48:16 2015 +0100

----------------------------------------------------------------------
 .../main/webapp/assets/js/model/server-extended-status.js | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-ui/blob/7680018f/usage/jsgui/src/main/webapp/assets/js/model/server-extended-status.js
----------------------------------------------------------------------
diff --git 
a/usage/jsgui/src/main/webapp/assets/js/model/server-extended-status.js 
b/usage/jsgui/src/main/webapp/assets/js/model/server-extended-status.js
index 2f5ccb3..e774294 100644
--- a/usage/jsgui/src/main/webapp/assets/js/model/server-extended-status.js
+++ b/usage/jsgui/src/main/webapp/assets/js/model/server-extended-status.js
@@ -73,13 +73,9 @@ define(["backbone", "brooklyn", "view/viewutils"], function 
(Backbone, Brooklyn,
         getMasterUri: function() {
             // Might be undefined if first fetch hasn't completed
             ha = this.get("ha") || {};
-            states = ha.states || {};
-            if (!states) return null;
-            
-            var nodes = this.get("nodes") || {};
-            var master = nodes[this.get("masterId")];
-            // defensive, if this happens something more serious has gone 
wrong!
-            if (!master) {
+            nodes = ha.nodes || {};
+            master = nodes[ha.masterId];
+            if (!master || master.status != "MASTER") {
                 return null;
             } else {
                 return master.nodeUri;

Reply via email to