Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 1db33d21f -> 5fb13c9ad


AMBARI-11730. When adding one host, the UI seems to be sending a request to add 
lot more (alexantonenko)


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

Branch: refs/heads/branch-2.1
Commit: 5fb13c9ad29b71827cfa39de2141f4bbc20c55aa
Parents: 1db33d2
Author: Alex Antonenko <hiv...@gmail.com>
Authored: Mon Jun 8 16:22:22 2015 +0300
Committer: Alex Antonenko <hiv...@gmail.com>
Committed: Mon Jun 8 16:24:06 2015 +0300

----------------------------------------------------------------------
 .../app/controllers/wizard/step3_controller.js    | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/5fb13c9a/ambari-web/app/controllers/wizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step3_controller.js 
b/ambari-web/app/controllers/wizard/step3_controller.js
index 8f89920..52c52ac 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -230,7 +230,7 @@ App.WizardStep3Controller = 
Em.Controller.extend(App.ReloadPopupMixin, {
     var bootStrapData = JSON.stringify({
         'verbose': true,
         'sshKey': this.get('content.installOptions.sshKey'),
-        'hosts': Em.keys(this.get('content.hosts')),
+        'hosts': this.getBootstrapHosts(),
         'user': this.get('content.installOptions.sshUser'),
         'userRunAs': App.get('supports.customizeAgentUserAccount') ? 
this.get('content.installOptions.agentUser') : 'root'
     });
@@ -245,6 +245,20 @@ App.WizardStep3Controller = 
Em.Controller.extend(App.ReloadPopupMixin, {
     });
   },
 
+  getBootstrapHosts: function () {
+    var hosts = this.get('content.hosts');
+    var bootstrapHosts = [];
+    for (var host in hosts) {
+      if (hosts.hasOwnProperty(host)) {
+        if (!hosts[host].isInstalled) {
+          bootstrapHosts.push(host);
+        }
+      }
+    }
+
+    return bootstrapHosts;
+  },
+
   /**
    * Make basic init steps
    * @method loadStep
@@ -870,7 +884,7 @@ App.WizardStep3Controller = 
Em.Controller.extend(App.ReloadPopupMixin, {
     });
   },
 
-  
+
   startHostcheck: function() {
     this.set('isWarningsLoaded', false);
     this.getHostNameResolution();

Reply via email to