Explorar o código

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

Alex Antonenko %!s(int64=10) %!d(string=hai) anos
pai
achega
ef9e122df7
Modificáronse 1 ficheiros con 16 adicións e 2 borrados
  1. 16 2
      ambari-web/app/controllers/wizard/step3_controller.js

+ 16 - 2
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();