Updated Branches:
  refs/heads/trunk a108b86f0 -> 0b66c706e

AMBARI-3828. JS error on Confirm Hosts page. (Mikhail Bayuk 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/0b66c706
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/0b66c706
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/0b66c706

Branch: refs/heads/trunk
Commit: 0b66c706e27de00c7a45010f5747d4ff391b5730
Parents: a108b86
Author: Yusaku Sako <yus...@hortonworks.com>
Authored: Thu Nov 21 10:56:53 2013 -0800
Committer: Yusaku Sako <yus...@hortonworks.com>
Committed: Thu Nov 21 10:56:53 2013 -0800

----------------------------------------------------------------------
 ambari-web/app/controllers/wizard/step3_controller.js | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0b66c706/ambari-web/app/controllers/wizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step3_controller.js 
b/ambari-web/app/controllers/wizard/step3_controller.js
index 266af03..dc04788 100644
--- a/ambari-web/app/controllers/wizard/step3_controller.js
+++ b/ambari-web/app/controllers/wizard/step3_controller.js
@@ -323,7 +323,14 @@ App.WizardStep3Controller = Em.Controller.extend({
   },
 
   doBootstrapSuccessCallback: function (data) {
-    if (data.hostsStatus !== null) {
+    var self = this;
+    var pollingInterval = 3000;
+    if (data.hostsStatus === undefined) {
+      console.log('Invalid response, setting timeout');
+      window.setTimeout(function () {
+        self.doBootstrap()
+      }, pollingInterval);
+    } else {
       // in case of bootstrapping just one host, the server returns an object 
rather than an array, so
       // force into an array
       if (!(data.hostsStatus instanceof Array)) {
@@ -356,10 +363,9 @@ App.WizardStep3Controller = Em.Controller.extend({
         this.startRegistration();
       }
       if (keepPolling) {
-        var self = this;
         window.setTimeout(function () {
           self.doBootstrap()
-        }, 3000);
+        }, pollingInterval);
       }
     }
   },

Reply via email to