You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by yu...@apache.org on 2013/11/22 01:52:33 UTC

git commit: AMBARI-3848. Remove Host JS Error in 'add host wizard'. (xiwang via yusaku)

Updated Branches:
  refs/heads/trunk ceaa02b23 -> 85206b97a


AMBARI-3848. Remove Host JS Error in 'add host wizard'. (xiwang via yusaku)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/85206b97
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/85206b97
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/85206b97

Branch: refs/heads/trunk
Commit: 85206b97a63491b1d4dd229d433a48a5f7561672
Parents: ceaa02b
Author: Yusaku Sako <yu...@hortonworks.com>
Authored: Thu Nov 21 16:46:01 2013 -0800
Committer: Yusaku Sako <yu...@hortonworks.com>
Committed: Thu Nov 21 16:46:24 2013 -0800

----------------------------------------------------------------------
 ambari-web/app/controllers/installer.js                |  7 +++----
 ambari-web/app/controllers/main/host/add_controller.js | 13 +++++++++++++
 2 files changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/85206b97/ambari-web/app/controllers/installer.js
----------------------------------------------------------------------
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 @@ App.InstallerController = App.WizardController.extend({
    * @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);
   },
 
   /**

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/85206b97/ambari-web/app/controllers/main/host/add_controller.js
----------------------------------------------------------------------
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 @@ App.AddHostController = App.WizardController.extend({
   },
 
   /**
+   * 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() {