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/0b397cdf Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/0b397cdf Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/0b397cdf Branch: refs/heads/branch-feature-logsearch-ui Commit: 0b397cdff959e04947fd6b15ada7a7c6a06aa55b Parents: 880853a 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 19:39:22 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/0b397cdf/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/0b397cdf/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 5919091..d6e6dfa 100644 --- a/ambari-web/app/utils/ajax/ajax.js +++ b/ambari-web/app/utils/ajax/ajax.js @@ -2356,6 +2356,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/0b397cdf/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; }); });