BUG-77784. Remove stop and start all services operations from RM HA wizard. (jaimin)
Change-Id: I32ac14d017aa5694c8d1dde27dbc1e6fba9ec626 Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e9e5dbcf Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e9e5dbcf Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e9e5dbcf Branch: refs/heads/AMBARI-2.4.2.16 Commit: e9e5dbcfea2315227790832988a1c8436c60a90e Parents: 1427726 Author: Jaimin Jetly <jai...@hortonworks.com> Authored: Wed Mar 22 19:05:37 2017 -0700 Committer: Jaimin Jetly <jai...@hortonworks.com> Committed: Wed Mar 22 19:05:37 2017 -0700 ---------------------------------------------------------------------- .../resourceManager/step4_controller.js | 7 +++++-- .../wizard/wizardProgressPageController.js | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/e9e5dbcf/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js index 722ae94..d525793 100644 --- a/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js +++ b/ambari-web/app/controllers/main/admin/highAvailability/resourceManager/step4_controller.js @@ -32,10 +32,13 @@ App.RMHighAvailabilityWizardStep4Controller = App.HighAvailabilityProgressPageCo initializeTasks: function () { this._super(); - var numSpliced = 0; + var tasksToRemove = []; + tasksToRemove.push('stopRequiredServices'); if (!App.Service.find().someProperty('serviceName', 'HAWQ')) { - this.get('tasks').splice(this.get('tasks').findProperty('command', 'reconfigureHAWQ').get('id'), 1); + tasksToRemove.push('reconfigureHAWQ'); } + tasksToRemove.push('startAllServices'); + this.removeTasks(tasksToRemove); }, stopRequiredServices: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/e9e5dbcf/ambari-web/app/mixins/wizard/wizardProgressPageController.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/wizard/wizardProgressPageController.js b/ambari-web/app/mixins/wizard/wizardProgressPageController.js index 3ee8a9a..d426eda 100644 --- a/ambari-web/app/mixins/wizard/wizardProgressPageController.js +++ b/ambari-web/app/mixins/wizard/wizardProgressPageController.js @@ -272,6 +272,26 @@ App.wizardProgressPageControllerMixin = Em.Mixin.create(App.InstallComponent, { } }, + /** + * remove tasks by command name + */ + removeTasks: function(commands) { + var tasks = this.get('tasks'); + + commands.forEach(function(command) { + var cmd = tasks.filterProperty('command', command); + var index = null; + + if (cmd.length === 0) { + return false; + } else { + index = tasks.indexOf( cmd[0] ); + } + + tasks.splice( index, 1 ); + }); + }, + setTaskStatus: function (taskId, status) { this.get('tasks').findProperty('id', taskId).set('status', status); },