瀏覽代碼

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

Yusaku Sako 11 年之前
父節點
當前提交
d727c0a159
共有 1 個文件被更改,包括 10 次插入9 次删除
  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);