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:52:34 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 6fa54aeeb -> 37baf9a1a


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/37baf9a1
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/37baf9a1
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/37baf9a1

Branch: refs/heads/trunk
Commit: 37baf9a1a96fe3d668666b12e9cc6f65e2f64439
Parents: 6fa54ae
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:50:33 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/37baf9a1/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 93b9f1f..4f88d2f 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
@@ -677,7 +677,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/37baf9a1/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 3acf1dd..4e93fd6 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
@@ -1110,10 +1110,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