ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rz...@apache.org
Subject ambari git commit: AMBARI-19576 - Downgrade request fails as existing Upgrade request is considered 'in progress' (rzang)
Date Tue, 17 Jan 2017 19:50:00 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.5 21e8e4bd8 -> e46330a94


AMBARI-19576 - Downgrade request fails as existing Upgrade request is considered 'in progress'
(rzang)


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

Branch: refs/heads/branch-2.5
Commit: e46330a9408fff096632a395b4c98f6481a70a60
Parents: 21e8e4b
Author: Richard Zang <rzang@apache.org>
Authored: Tue Jan 17 11:49:23 2017 -0800
Committer: Richard Zang <rzang@apache.org>
Committed: Tue Jan 17 11:49:23 2017 -0800

----------------------------------------------------------------------
 .../controllers/main/admin/stack_and_upgrade_controller.js    | 7 ++++++-
 .../main/admin/stack_and_upgrade_controller_test.js           | 4 ----
 2 files changed, 6 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e46330a9/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
index 3058580..44faf4d 100644
--- a/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
+++ b/ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js
@@ -658,7 +658,12 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
     var self = this;
     this.set('requestInProgress', true);
     this.abortUpgrade().done(function() {
-      self.startDowngrade(currentVersion);
+      var interval = setInterval(function() {
+        if (self.get('upgradeData.Upgrade.request_status') == 'ABORTED') {
+          clearInterval(interval);
+          self.startDowngrade(currentVersion);
+        }
+      }, 1000);
     });
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/e46330a9/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
index 78e81a0..9e04214 100644
--- a/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
+++ b/ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js
@@ -1136,10 +1136,6 @@ describe('App.MainAdminStackAndUpgradeController', function() {
       expect(controller.abortUpgrade.calledOnce).to.be.true;
     });
 
-    it('should run startDowngrade on done', function() {
-      expect(controller.startDowngrade.calledWith('versionInfo')).to.be.true;
-    });
-
   });
 
   describe("#startDowngrade()", function() {


Mime
View raw message