Updated Branches:
  refs/heads/trunk bf8b16576 -> abb8020e2

AMBARI-3207. NameNode HA wizard (rollback): Task gets status completed, even 
when one of its subtasks fails


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/abb8020e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/abb8020e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/abb8020e

Branch: refs/heads/trunk
Commit: abb8020e29e83f82114ba2f7d6582d3aab6d4ca4
Parents: bf8b165
Author: Alex Antonenko <[email protected]>
Authored: Thu Sep 12 19:16:52 2013 +0300
Committer: Alex Antonenko <[email protected]>
Committed: Thu Sep 12 19:16:52 2013 +0300

----------------------------------------------------------------------
 .../main/admin/highAvailability/rollback_controller.js   | 11 +++++++++++
 1 file changed, 11 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/abb8020e/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js
----------------------------------------------------------------------
diff --git 
a/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js 
b/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js
index ac5e2be..74f941c 100644
--- 
a/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js
+++ 
b/ambari-web/app/controllers/main/admin/highAvailability/rollback_controller.js
@@ -149,6 +149,17 @@ App.HighAvailabilityRollbackController = 
App.HighAvailabilityProgressPageControl
     });
   },
 
+  onTaskCompleted: function () {
+    var curTaskStatus = this.getTaskStatus(this.get('currentTaskId'));
+    if (curTaskStatus != 'FAILED' && curTaskStatus != 'TIMEDOUT' && 
curTaskStatus != 'ABORTED') {
+      this.setTaskStatus(this.get('currentTaskId'), 'COMPLETED');
+    }
+  },
+
+  getTaskStatus: function (taskId) {
+    return this.get('tasks').findProperty('id', taskId).get('status');
+  },
+
   saveTasksStatuses: function(statuses){
     App.db.setHighAvailabilityWizardTasksStatuses(statuses);
     this.set('content.tasksStatuses', statuses);

Reply via email to