AMBARI-3864. JS Error in 'Add Host Wizard' if we proceed with failed registered hosts. (xiwang via yusaku)
diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js
index c22158e..48c1cb0 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -539,16 +539,17 @@
*/
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);