AMBARI-21443. Start All service not getting invoked after regenerate keytabs (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/e92aae45 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e92aae45 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e92aae45 Branch: refs/heads/branch-feature-AMBARI-21348 Commit: e92aae457b9e7cac74321659187fed427b5c8d58 Parents: 4590eb3 Author: Aleksandr Kovalenko <akovale...@hortonworks.com> Authored: Tue Jul 11 17:22:37 2017 +0300 Committer: Aleksandr Kovalenko <akovale...@hortonworks.com> Committed: Tue Jul 11 17:22:37 2017 +0300 ---------------------------------------------------------------------- ambari-web/app/controllers/main/service.js | 13 +++++++++++- ambari-web/app/utils/ajax/ajax.js | 22 ++++++++++++++++++++ .../test/controllers/main/service_test.js | 4 ++-- 3 files changed, 36 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/e92aae45/ambari-web/app/controllers/main/service.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service.js b/ambari-web/app/controllers/main/service.js index eb9df0d..343105f 100644 --- a/ambari-web/app/controllers/main/service.js +++ b/ambari-web/app/controllers/main/service.js @@ -177,9 +177,20 @@ App.MainServiceController = Em.ArrayController.extend(App.SupportClientConfigsDo }, /** - * Restart all services - stops all services, then starts them back + * Restart all services - restarts by sending one RESTART command */ restartAllServices: function () { + App.ajax.send({ + name: 'restart.allServices', + sender: this, + showLoadingPopup: true + }); + }, + + /** + * Restart all services - stops all services, then starts them back + */ + stopAndStartAllServices: function () { this.silentStopAllServices(); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/e92aae45/ambari-web/app/utils/ajax/ajax.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js index eab94bb..daad29e 100644 --- a/ambari-web/app/utils/ajax/ajax.js +++ b/ambari-web/app/utils/ajax/ajax.js @@ -2349,6 +2349,28 @@ var urls = { } }, + 'restart.allServices': { + 'real': '/clusters/{clusterName}/requests', + 'mock': '', + 'format': function (data) { + return { + type: 'POST', + data: JSON.stringify({ + "RequestInfo": { + "command": "RESTART", + "context": 'Restart all services', + "operation_level": 'host_component' + }, + "Requests/resource_filters": [ + { + "hosts_predicate": "HostRoles/cluster_name=" + data.clusterName + } + ] + }) + } + } + }, + 'restart.staleConfigs': { 'real': "/clusters/{clusterName}/requests", 'mock': "", http://git-wip-us.apache.org/repos/asf/ambari/blob/e92aae45/ambari-web/test/controllers/main/service_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/main/service_test.js b/ambari-web/test/controllers/main/service_test.js index 7ed7641..57a3eb4 100644 --- a/ambari-web/test/controllers/main/service_test.js +++ b/ambari-web/test/controllers/main/service_test.js @@ -433,7 +433,7 @@ describe('App.MainServiceController', function () { }); - describe("#restartAllServices()", function() { + describe("#stopAndStartAllServices()", function() { beforeEach(function() { sinon.stub(mainServiceController, 'silentStopAllServices'); @@ -443,7 +443,7 @@ describe('App.MainServiceController', function () { }); it("silentStopAllServices should be called", function() { - mainServiceController.restartAllServices(); + mainServiceController.stopAndStartAllServices(); expect(mainServiceController.silentStopAllServices.calledOnce).to.be.true; }); });