Repository: ambari Updated Branches: refs/heads/trunk 1df953d68 -> f495bbc02
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/f495bbc0 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/f495bbc0 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/f495bbc0 Branch: refs/heads/trunk Commit: f495bbc02e462981720956b5e61ec102f746728f Parents: 1df953d Author: Jun Aoki <ja...@apache.org> Authored: Thu Feb 25 14:11:19 2016 -0800 Committer: Jun Aoki <ja...@apache.org> Committed: Thu Feb 25 14:11:19 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/f495bbc0/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 645c996..c1c4d0e 100644 --- a/ambari-web/app/mixins/wizard/assign_master_components.js +++ b/ambari-web/app/mixins/wizard/assign_master_components.js @@ -754,19 +754,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/f495bbc0/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)); }); });