You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2015/09/07 19:06:50 UTC
ambari git commit: AMBARI-13025 Switching config versions results in
'Restart Required' message showing up with delay. (atkach)
Repository: ambari
Updated Branches:
refs/heads/branch-2.1 b7fb7472e -> 617619928
AMBARI-13025 Switching config versions results in 'Restart Required' message showing up with delay. (atkach)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/61761992
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/61761992
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/61761992
Branch: refs/heads/branch-2.1
Commit: 6176199288601ed0fff465273ce016d9a3a22f4f
Parents: b7fb747
Author: Andrii Tkach <at...@hortonworks.com>
Authored: Mon Sep 7 17:42:54 2015 +0300
Committer: Andrii Tkach <at...@hortonworks.com>
Committed: Mon Sep 7 17:42:54 2015 +0300
----------------------------------------------------------------------
ambari-web/app/controllers/global/cluster_controller.js | 10 +++++-----
.../app/views/common/configs/config_history_flow.js | 3 ++-
.../views/common/configs/config_history_flow_test.js | 11 +++++++++--
3 files changed, 16 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/61761992/ambari-web/app/controllers/global/cluster_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/cluster_controller.js b/ambari-web/app/controllers/global/cluster_controller.js
index f564daa..dbd7a1b 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -221,6 +221,11 @@ App.ClusterController = Em.Controller.extend({
self.updateLoadStatus('stackComponents');
updater.updateServices(function () {
self.updateLoadStatus('services');
+
+ //hosts should be loaded after services in order to properly populate host-component relation in App.cache.services
+ updater.updateHost(function () {
+ self.set('isHostsLoaded', true);
+ });
App.config.loadConfigsFromStack(App.Service.find().mapProperty('serviceName')).complete(function () {
App.config.loadClusterConfigsFromStack().complete(function () {
self.set('isConfigsPropertiesLoaded', true);
@@ -245,11 +250,6 @@ App.ClusterController = Em.Controller.extend({
//force clear filters for hosts page to load all data
App.db.setFilterConditions('mainHostController', null);
- // hosts loading doesn't affect overall progress
- updater.updateHost(function () {
- self.set('isHostsLoaded', true);
- });
-
// alerts loading doesn't affect overall progress
console.time('Overall alerts loading time');
updater.updateAlertGroups(function () {
http://git-wip-us.apache.org/repos/asf/ambari/blob/61761992/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index b51ea4a..ae0c985 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -432,7 +432,8 @@ App.ConfigHistoryFlowView = Em.View.extend({
sendRevertCallSuccess: function (data, opt, params) {
// revert to an old version would generate a new version with latest version number,
// so, need to loadStep to update
- this.get('controller').loadStep();
+ App.router.get('updateController').updateComponentConfig(Em.K);
+ this.get('controller').loadStep();
},
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/61761992/ambari-web/test/views/common/configs/config_history_flow_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/common/configs/config_history_flow_test.js b/ambari-web/test/views/common/configs/config_history_flow_test.js
index c272436..8d76946 100644
--- a/ambari-web/test/views/common/configs/config_history_flow_test.js
+++ b/ambari-web/test/views/common/configs/config_history_flow_test.js
@@ -569,12 +569,19 @@ describe.skip('App.ConfigHistoryFlowView', function () {
});
describe('#sendRevertCallSuccess()', function () {
- it('', function () {
+ beforeEach(function () {
sinon.spy(view.get('controller'), 'loadStep');
+ sinon.stub(App.router.get('updateController'), 'updateComponentConfig', Em.K);
+ });
+ afterEach(function () {
+ view.get('controller').loadStep.restore();
+ App.router.get('updateController').updateComponentConfig.restore();
+ });
+ it('', function () {
view.sendRevertCallSuccess();
expect(view.get('controller').loadStep.calledOnce).to.be.true;
- view.get('controller').loadStep.restore();
+ expect(App.router.get('updateController').updateComponentConfig.calledOnce).to.be.true;
});
});