浏览代码

AMBARI-1315. Inconsistent error/warning status in Deploy step; install stalls. (Arun Kandregula via yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1440750 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 年之前
父节点
当前提交
8c4dd7bf7f

+ 3 - 0
CHANGES.txt

@@ -199,6 +199,9 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1315. Inconsistent error/warning status in Deploy step; install
+ stalls. (Arun Kandregula via yusaku)
+
  AMBARI-1281. Heatmap does not show up if the cluster was installed by going
  back to a previous step from the Deploy step after an install failure.
  (yusaku)

+ 4 - 1
ambari-web/app/controllers/wizard/step1_controller.js

@@ -26,7 +26,10 @@ App.WizardStep1Controller = Em.Controller.extend({
   loadStep: function () {
     this.set('hasSubmitted',false);
   },
-
+  /**
+   * validate cluster name
+   * set clusterNameError if validation fails
+   */
   invalidClusterName : function(){
     if(!this.get('hasSubmitted')){
       this.set('clusterNameError', '');

+ 28 - 8
ambari-web/app/controllers/wizard/step2_controller.js

@@ -48,7 +48,9 @@ App.WizardStep2Controller = Em.Controller.extend({
     // return validator.isHostname(hostname) && (!(/^\-/.test(hostname) || /\-$/.test(hostname)));
     return true;
   },
-
+  /**
+   * set not installed hosts to the hostNameArr
+   */
   updateHostNameArr: function(){
     this.hostNameArr = this.get('hostNames').trim().split(new RegExp("\\s+", "g"));
     this.patternExpression();
@@ -61,7 +63,10 @@ App.WizardStep2Controller = Em.Controller.extend({
     }
     this.set('hostNameArr', tempArr);
   },
-
+  /**
+   * validate host names
+   * @return {Boolean}
+   */
   isAllHostNamesValid: function () {
     var self = this;
     var result = true;
@@ -77,7 +82,9 @@ App.WizardStep2Controller = Em.Controller.extend({
   },
 
   hostsError: null,
-
+  /**
+   * set hostsError if host names don't pass validation
+   */
   checkHostError: function () {
     if (this.get('hostNames').trim() === '') {
       this.set('hostsError', Em.I18n.t('installer.step2.hostName.error.required'));
@@ -169,7 +176,10 @@ App.WizardStep2Controller = Em.Controller.extend({
 
     this.proceedNext();
   },
-
+  /**
+   * check is there a pattern expression in host name textarea
+   * push hosts that match pattern in hostNamesArr
+   */
   patternExpression: function(){
     this.isPattern = false;
     var self = this;
@@ -178,7 +188,7 @@ App.WizardStep2Controller = Em.Controller.extend({
       var start, end, extra = {0:""};
       if(/\[\d*\-\d*\]/.test(a)){
         start=a.match(/\[\d*/);
-        end=a.match(/\-\d*/);
+        end=a.match(/\-\d*]/);
 
         start=start[0].substr(1);
         end=end[0].substr(1);
@@ -203,7 +213,11 @@ App.WizardStep2Controller = Em.Controller.extend({
     });
     this.hostNameArr =  hostNames;
   },
-
+  /**
+   * launch hosts to bootstrap
+   * and save already registered hosts
+   * @return {Boolean}
+   */
   proceedNext: function(){
     if (this.get('manualInstall') === true) {
       this.manualInstallPopup();
@@ -226,7 +240,10 @@ App.WizardStep2Controller = Em.Controller.extend({
       this.saveHosts();
     }
   },
-
+  /**
+   * show popup with hosts generated by pattern
+   * @param hostNames
+   */
   hostNamePatternPopup: function (hostNames) {
     var self = this;
     App.ModalPopup.show({
@@ -241,7 +258,10 @@ App.WizardStep2Controller = Em.Controller.extend({
       })
     });
   },
-
+  /**
+   * show notify that installation is manual
+   * save hosts
+   */
   manualInstallPopup: function () {
     var self = this;
     App.ModalPopup.show({

+ 11 - 0
ambari-web/app/controllers/wizard/step9_controller.js

@@ -127,6 +127,17 @@ App.WizardStep9Controller = Em.Controller.extend({
     this.clearStep();
     this.renderHosts(this.loadHosts());
   },
+  /**
+   * reset status and message of all hosts when retry install
+   */
+  resetHostsForRetry: function(){
+    var hosts = this.get('content.hosts');
+    for (var name in hosts) {
+      hosts[name].status = "pending";
+      hosts[name].message = 'Waiting';
+    }
+    this.set('content.hosts', hosts);
+  },
 
   loadHosts: function () {
     var hostInfo = this.get('content.hosts');

+ 1 - 0
ambari-web/app/routes/installer.js

@@ -319,6 +319,7 @@ module.exports = Em.Route.extend({
           var isRetry = true;
           installerController.installServices(isRetry);
           installerController.setInfoForStep9();
+          wizardStep9Controller.resetHostsForRetry();
           // We need to do recovery based on whether we are in Add Host or Installer wizard
           App.clusterStatus.setClusterStatus({
             clusterName: this.get('clusterName'),