Repository: ambari
Updated Branches:
  refs/heads/trunk 6153b0372 -> b028fc86a


AMBARI-19200 Turning OFF maintenance mode shows a popup on all hosts. (atkach)


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

Branch: refs/heads/trunk
Commit: b028fc86ab8898c9e9621bdd0907826431301e65
Parents: 6153b03
Author: Andrii Tkach <[email protected]>
Authored: Wed Dec 14 14:59:04 2016 +0200
Committer: Andrii Tkach <[email protected]>
Committed: Wed Dec 14 17:38:20 2016 +0200

----------------------------------------------------------------------
 .../app/controllers/global/cluster_controller.js     | 15 +++++++--------
 .../controllers/global/cluster_controller_test.js    |  4 ++--
 2 files changed, 9 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b028fc86/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 edb9a26..d7cedd3 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -332,20 +332,19 @@ App.ClusterController = 
Em.Controller.extend(App.ReloadPopupMixin, {
       }
 
       //completed upgrade shouldn't be restored
-      if (lastUpgradeData && lastUpgradeData.Upgrade.request_status === 
"COMPLETED") {
-        return;
+      if (lastUpgradeData) {
+        if (lastUpgradeData.Upgrade.request_status !== "COMPLETED") {
+          upgradeController.restoreLastUpgrade(lastUpgradeData);
+        }
+      } else {
+        upgradeController.initDBProperties();
+        upgradeController.loadUpgradeData(true);
       }
 
       if (!Em.isNone(dbUpgradeState)) {
         App.set('upgradeState', dbUpgradeState);
       }
 
-      if (lastUpgradeData) {
-        upgradeController.restoreLastUpgrade(lastUpgradeData);
-      } else {
-        upgradeController.initDBProperties();
-        upgradeController.loadUpgradeData(true);
-      }
       upgradeController.loadStackVersionsToModel(true).done(function () {
         App.set('stackVersionsAvailable', 
App.StackVersion.find().content.length > 0);
       });

http://git-wip-us.apache.org/repos/asf/ambari/blob/b028fc86/ambari-web/test/controllers/global/cluster_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/global/cluster_controller_test.js 
b/ambari-web/test/controllers/global/cluster_controller_test.js
index fa95c3e..47708ac 100644
--- a/ambari-web/test/controllers/global/cluster_controller_test.js
+++ b/ambari-web/test/controllers/global/cluster_controller_test.js
@@ -533,8 +533,8 @@ describe('App.clusterController', function () {
         expect(upgradeController.restoreLastUpgrade.called).to.be.false;
       });
 
-      it('loadStackVersionsToModel should not be called', function () {
-        expect(upgradeController.loadStackVersionsToModel.called).to.be.false;
+      it('loadStackVersionsToModel should be called', function () {
+        expect(upgradeController.loadStackVersionsToModel).to.be.calledOnce;
       });
     });
 

Reply via email to