AMBARI-3848. Remove Host JS Error in 'add host wizard'. (xiwang via yusaku)
diff --git a/ambari-web/app/controllers/installer.js b/ambari-web/app/controllers/installer.js
index b669a25..dbb0923 100644
--- a/ambari-web/app/controllers/installer.js
+++ b/ambari-web/app/controllers/installer.js
@@ -75,13 +75,12 @@
    * @param hosts Array of hosts, which we want to delete
    */
   removeHosts: function (hosts) {
-    //todo Replace this code with real logic
-    var DBhosts = this.getDBProperty('hosts');
+    var dbHosts = this.getDBProperty('hosts');
     hosts.forEach(function (_hostInfo) {
       var host = _hostInfo.hostName;
-      delete DBhosts[host];
+      delete dbHosts[host];
     });
-    this.setDBProperty('hosts', DBhosts);
+    this.setDBProperty('hosts', dbHosts);
   },
 
   /**
diff --git a/ambari-web/app/controllers/main/host/add_controller.js b/ambari-web/app/controllers/main/host/add_controller.js
index 8251781..dc66cca 100644
--- a/ambari-web/app/controllers/main/host/add_controller.js
+++ b/ambari-web/app/controllers/main/host/add_controller.js
@@ -92,6 +92,19 @@
   },
 
   /**
+   * Remove host from model. Used at <code>Confirm hosts</code> step
+   * @param hosts Array of hosts, which we want to delete
+   */
+  removeHosts: function (hosts) {
+    var dbHosts = this.getDBProperty('hosts');
+    hosts.forEach(function (_hostInfo) {
+      var host = _hostInfo.hostName;
+      delete dbHosts[host];
+    });
+    this.setDBProperty('hosts', dbHosts);
+  },
+
+  /**
    * Load services data from server.
    */
   loadServicesFromServer: function() {