Browse Source

AMBARI-3864. JS Error in 'Add Host Wizard' if we proceed with failed registered hosts. (xiwang via yusaku)

Yusaku Sako 11 years ago
parent
commit
d727c0a159
1 changed files with 10 additions and 9 deletions
  1. 10 9
      ambari-web/app/controllers/wizard.js

+ 10 - 9
ambari-web/app/controllers/wizard.js

@@ -539,16 +539,17 @@ App.WizardController = Em.Controller.extend({
    */
   saveConfirmedHosts: function (stepController) {
     var hostInfo = {};
-
     stepController.get('content.hosts').forEach(function (_host) {
-      hostInfo[_host.name] = {
-        name: _host.name,
-        cpu: _host.cpu,
-        memory: _host.memory,
-        disk_info: _host.disk_info,
-        bootStatus: _host.bootStatus,
-        isInstalled: false
-      };
+      if (_host.bootStatus == 'REGISTERED') {
+        hostInfo[_host.name] = {
+          name: _host.name,
+          cpu: _host.cpu,
+          memory: _host.memory,
+          disk_info: _host.disk_info,
+          bootStatus: _host.bootStatus,
+          isInstalled: false
+        };
+      }
     });
     console.log('wizardController:saveConfirmedHosts: save hosts ', hostInfo);
     this.setDBProperty('hosts', hostInfo);