Repository: ambari Updated Branches: refs/heads/trunk f89181b42 -> b41ba67e6
AMBARI-6267 Add Services fails with a server error under some conditions.(atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b41ba67e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b41ba67e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b41ba67e Branch: refs/heads/trunk Commit: b41ba67e6090515aa9a13200958bb4642e8ac413 Parents: f89181b Author: atkach <[email protected]> Authored: Wed Jun 25 15:25:51 2014 +0300 Committer: atkach <[email protected]> Committed: Wed Jun 25 15:25:51 2014 +0300 ---------------------------------------------------------------------- .../app/controllers/wizard/step8_controller.js | 18 +++++++++++++----- ambari-web/app/utils/ajax/ajax.js | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/b41ba67e/ambari-web/app/controllers/wizard/step8_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js index ca25817..c2b29f7 100644 --- a/ambari-web/app/controllers/wizard/step8_controller.js +++ b/ambari-web/app/controllers/wizard/step8_controller.js @@ -1221,11 +1221,19 @@ App.WizardStep8Controller = Em.Controller.extend({ /** * check whether clients are already installed on selected master hosts!!! */ - var clientHosts = App.HostComponent.find().filterProperty("componentName",_client.component_name).filterProperty("workStatus", "INSTALLED"); - if (clientHosts.length>0) { - clientHosts.mapProperty('hostName').forEach(function (host) { - if (hostNames.contains(host)) { - hostNames.splice(hostNames.indexOf(host), 1); + var clientHosts = []; + var installedHosts = this.get('content.hosts'); + for (var hostName in installedHosts) { + if (installedHosts[hostName].isInstalled && + installedHosts[hostName].hostComponents.filterProperty('HostRoles.state', 'INSTALLED').mapProperty('HostRoles.component_name').contains(_client.component_name)) { + clientHosts.push(hostName); + } + } + + if (clientHosts.length > 0) { + clientHosts.forEach(function (hostName) { + if (hostNames.contains(hostName)) { + hostNames.splice(hostNames.indexOf(hostName), 1); } }, this); } http://git-wip-us.apache.org/repos/asf/ambari/blob/b41ba67e/ambari-web/app/utils/ajax/ajax.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js index 975e3c7..2e29cb0 100644 --- a/ambari-web/app/utils/ajax/ajax.js +++ b/ambari-web/app/utils/ajax/ajax.js @@ -2075,7 +2075,7 @@ var urls = { 'mock': '' }, 'hosts.confirmed': { - 'real': '/clusters/{clusterName}/hosts?fields=Hosts/cpu_count,Hosts/disk_info,Hosts/total_mem,host_components&minimal_response=true', + 'real': '/clusters/{clusterName}/hosts?fields=Hosts/cpu_count,Hosts/disk_info,Hosts/total_mem,host_components/HostRoles/state&minimal_response=true', 'mock': '' }, 'host_components.all': {
