ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject ambari git commit: AMBARI-19657: Downgrade button does not work after restart Ambari server when upgrade wizard was left open (dili)
Date Mon, 23 Jan 2017 20:27:08 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk a51ede848 -> 7b0ee28ef


AMBARI-19657: Downgrade button does not work after restart Ambari server when upgrade wizard
was left open (dili)


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

Branch: refs/heads/trunk
Commit: 7b0ee28ef2a313335ff81ef62574c37ca6fe1347
Parents: a51ede8
Author: Di Li <dili@apache.org>
Authored: Mon Jan 23 15:26:52 2017 -0500
Committer: Di Li <dili@apache.org>
Committed: Mon Jan 23 15:26:52 2017 -0500

----------------------------------------------------------------------
 .../main/admin/stack_and_upgrade_controller.js  | 21 +++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/7b0ee28e/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 4f88d2f..a585615 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
@@ -385,13 +385,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
       self.loadStackVersionsToModel(true).done(function () {
         self.loadRepoVersionsToModel().done(function() {
           self.loadCompatibleVersions().done(function() {
-            var currentVersion = App.StackVersion.find().findProperty('state', 'CURRENT');
-            if (currentVersion) {
-              self.set('currentVersion', {
-                repository_version: currentVersion.get('repositoryVersion.repositoryVersion'),
-                repository_name: currentVersion.get('repositoryVersion.displayName')
-              });
-            }
+            self.updateCurrentStackVersion();
             dfd.resolve();
           });
         });
@@ -400,6 +394,16 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
     return dfd.promise();
   },
 
+  updateCurrentStackVersion: function(){
+    var currentVersion = App.StackVersion.find().findProperty('state', 'CURRENT');
+    if (currentVersion) {
+      this.set('currentVersion', {
+        repository_version: currentVersion.get('repositoryVersion.repositoryVersion'),
+        repository_name: currentVersion.get('repositoryVersion.displayName')
+      });
+    }
+  },
+
   /**
    * load upgrade tasks by upgrade id
    * @return {$.Deferred}
@@ -656,6 +660,9 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
    */
   confirmDowngrade: function (event) {
     var self = this;
+    if(!this.get('currentVersion')){
+      this.updateCurrentStackVersion();
+    }
     var currentVersion = this.get('currentVersion');
     return App.showConfirmationPopup(
       function() {


Mime
View raw message