Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 a57c458c3 -> b0a714937


AMBARI-14987: assign_master_component.js does not show recommendations while 
adding master component for a service which is already installed (mithmatt via 
jaoki)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b0a71493
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b0a71493
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b0a71493

Branch: refs/heads/branch-2.2
Commit: b0a7149373d48e2c7b4cce06b0b26a6d1c87b0ec
Parents: a57c458
Author: Jun Aoki <ja...@apache.org>
Authored: Thu Feb 25 14:11:54 2016 -0800
Committer: Jun Aoki <ja...@apache.org>
Committed: Thu Feb 25 14:11:54 2016 -0800

----------------------------------------------------------------------
 ambari-web/app/mixins/wizard/assign_master_components.js  | 10 +++-------
 .../test/mixins/wizard/assign_master_components_test.js   |  2 +-
 2 files changed, 4 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b0a71493/ambari-web/app/mixins/wizard/assign_master_components.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/wizard/assign_master_components.js 
b/ambari-web/app/mixins/wizard/assign_master_components.js
index 62efdac..efcb02e 100644
--- a/ambari-web/app/mixins/wizard/assign_master_components.js
+++ b/ambari-web/app/mixins/wizard/assign_master_components.js
@@ -761,19 +761,15 @@ App.AssignMasterComponents = Em.Mixin.create({
     var hostsForHostGroup = {};
 
     
recommendations.blueprint_cluster_binding.host_groups.forEach(function(hostGroup)
 {
-      hostsForHostGroup[hostGroup.name] = hostGroup.hosts.map(function(host) {
-        return host.fqdn;
-      });
+      hostsForHostGroup[hostGroup.name] = hostGroup.hosts.mapProperty('fqdn');
     });
 
     recommendations.blueprint.host_groups.forEach(function (hostGroup) {
-      var components = hostGroup.components.map(function (component) {
-        return component.name;
-      });
+      var components = hostGroup.components.mapProperty('name');
       components.forEach(function (componentName) {
         var hostList = recommendedHostsForComponent[componentName] || [];
         var hostNames = hostsForHostGroup[hostGroup.name] || [];
-        Array.prototype.push.apply(hostList, hostNames);
+        hostList.pushObjects(hostNames);
         recommendedHostsForComponent[componentName] = hostList;
       });
     });

http://git-wip-us.apache.org/repos/asf/ambari/blob/b0a71493/ambari-web/test/mixins/wizard/assign_master_components_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/mixins/wizard/assign_master_components_test.js 
b/ambari-web/test/mixins/wizard/assign_master_components_test.js
index a3ffb22..d8ccd66 100644
--- a/ambari-web/test/mixins/wizard/assign_master_components_test.js
+++ b/ambari-web/test/mixins/wizard/assign_master_components_test.js
@@ -93,7 +93,7 @@ describe('App.AssignMasterComponents', function () {
         "c2": ["h1", "h2", "h4"]
       };
 
-      
expect(c.get('content.recommendedHostsForComponents')).to.deep.equal(expected);
+      
expect(JSON.stringify(c.get('content.recommendedHostsForComponents'))).to.equal(JSON.stringify(expected));
     });
   });
 

Reply via email to