Browse Source

AMBARI-1956. Wrong install status shown in Add Service Wizard. (yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/trunk@1469123 13f79535-47bb-0310-9956-ffa450edef68
Yusaku Sako 12 years ago
parent
commit
ec9bf2bd3a

+ 2 - 0
CHANGES.txt

@@ -747,6 +747,8 @@ Trunk (unreleased changes):
 
  BUG FIXES
 
+ AMBARI-1956. Wrong install status shown in Add Service Wizard. (yusaku)
+
  AMBARI-1951. Ambari agent setup during bootstrap should install the same
  version of agent as the server. (smohanty)
 

+ 13 - 1
ambari-web/app/controllers/wizard/step9_controller.js

@@ -399,10 +399,22 @@ App.WizardStep9Controller = Em.Controller.extend({
     if (actions.someProperty('Tasks.status', 'FAILED') || actions.someProperty('Tasks.status', 'ABORTED') || actions.someProperty('Tasks.status', 'TIMEDOUT')) {
       contentHost.set('status', 'warning');
     }
-    if (this.get('content.cluster.status') === 'PENDING' && actions.someProperty('Tasks.status', 'FAILED')) {
+    if ((this.get('content.cluster.status') === 'PENDING' && actions.someProperty('Tasks.status', 'FAILED')) || (this.isMasterFailed(actions))) {
       contentHost.set('status', 'failed');
     }
   },
+  //return true if there is at least one FAILED task of master component install
+  isMasterFailed: function(polledData) {
+    var result = false;
+    polledData.filterProperty('Tasks.command', 'INSTALL').filterProperty('Tasks.status', 'FAILED').mapProperty('Tasks.role').forEach (
+      function (task) {
+        if (!['DATANODE', 'TASKTRACKER', 'HBASE_REGIONSERVER', 'GANGLIA_MONITOR'].contains(task)) {
+          result = true;
+        }
+      }
+    );
+    return result;
+  },
 
   onInProgressPerHost: function (tasks, contentHost) {
     var runningAction = tasks.findProperty('Tasks.status', 'IN_PROGRESS');

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

@@ -248,6 +248,7 @@ module.exports = Em.Route.extend({
           var isRetry = true;
           addServiceController.installServices(isRetry);
           addServiceController.setInfoForStep9();
+          wizardStep9Controller.resetHostsForRetry();
           // We need to do recovery based on whether we are in Add Host or Installer wizard
           addServiceController.saveClusterState('ADD_SERVICES_INSTALLING_3');
         }