Author: yusaku
Date: Fri Jan 11 02:52:17 2013
New Revision: 1431836

URL: http://svn.apache.org/viewvc?rev=1431836&view=rev
Log:
AMBARI-1153. Host jams in status 'Preparing' if host name is wrong. (Arun 
Kandregula via yusaku)

Modified:
    incubator/ambari/trunk/CHANGES.txt
    incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js

Modified: incubator/ambari/trunk/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1431836&r1=1431835&r2=1431836&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Fri Jan 11 02:52:17 2013
@@ -675,6 +675,9 @@ AMBARI-666 branch (unreleased changes)
 
   BUG FIXES
 
+  AMBARI-1153. Host jams in status 'Preparing' if host name is wrong.
+  (Arun Kandregula via yusaku)
+
   AMBARI-1132. Stopping service doesn't cause blinking status until refresh.
   (Srimanth Gunturi via yusaku)
 

Modified: 
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js
URL: 
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js?rev=1431836&r1=1431835&r2=1431836&view=diff
==============================================================================
--- 
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js 
(original)
+++ 
incubator/ambari/trunk/ambari-web/app/controllers/wizard/step3_controller.js 
Fri Jan 11 02:52:17 2013
@@ -287,6 +287,25 @@ App.WizardStep3Controller = Em.Controlle
           }
           console.log("TRACE: In success function for the GET bootstrap call");
           var keepPolling = self.parseHostInfo(data.hostsStatus);
+
+          // Single host : if the only hostname is invalid (data.status == 
'ERROR')
+          // Multiple hosts : if one or more hostnames are invalid
+          // following check will mark the bootStatus as 'FAILED' for the 
invalid hostname
+          if (data.status == 'ERROR' || data.hostsStatus.length != 
self.get('bootHosts').length) {
+
+            var hosts = self.get('bootHosts');
+
+            for (var i = 0; i < hosts.length; i++) {
+
+              var isValidHost = data.hostsStatus.someProperty('hostName', 
hosts[i].get('name'));
+
+              if (!isValidHost) {
+                hosts[i].set('bootStatus', 'FAILED');
+                hosts[i].set('bootLog', 'Registration with the server 
failed.');
+              }
+            }
+          }
+
           if (data.hostsStatus.someProperty('status', 'DONE') || 
data.hostsStatus.someProperty('status', 'FAILED')) {
             // kicking off registration polls after at least one host has 
succeeded
             self.startRegistration();


Reply via email to