Explorar o código

AMBARI-1153. Host jams in status 'Preparing' if host name is wrong. (Arun Kandregula via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1431836 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako %!s(int64=12) %!d(string=hai) anos
pai
achega
4dabb5a46d
Modificáronse 2 ficheiros con 22 adicións e 0 borrados
  1. 3 0
      CHANGES.txt
  2. 19 0
      ambari-web/app/controllers/wizard/step3_controller.js

+ 3 - 0
CHANGES.txt

@@ -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)
 

+ 19 - 0
ambari-web/app/controllers/wizard/step3_controller.js

@@ -287,6 +287,25 @@ App.WizardStep3Controller = Em.Controller.extend({
           }
           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();