ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject ambari git commit: AMBARI-11928 RU: UI does not specify from_version when downgrading. (ababiichuk)
Date Mon, 15 Jun 2015 17:44:57 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk df082c1b1 -> cae5552e6


AMBARI-11928 RU: UI does not specify from_version when downgrading. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: cae5552e607bcc2b369819ea05805cfa1af685bd
Parents: df082c1
Author: aBabiichuk <ababiichuk@hortonworks.com>
Authored: Mon Jun 15 20:44:12 2015 +0300
Committer: aBabiichuk <ababiichuk@hortonworks.com>
Committed: Mon Jun 15 20:44:26 2015 +0300

----------------------------------------------------------------------
 .../app/controllers/global/cluster_controller.js     |  2 +-
 .../main/admin/stack_and_upgrade_controller.js       |  1 +
 ambari-web/app/utils/ajax/ajax.js                    |  1 +
 .../main/admin/stack_and_upgrade_controller_test.js  | 15 ++++++++++++++-
 4 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/cae5552e/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 7f6704c..5cc005a 100644
--- a/ambari-web/app/controllers/global/cluster_controller.js
+++ b/ambari-web/app/controllers/global/cluster_controller.js
@@ -334,7 +334,7 @@ App.ClusterController = Em.Controller.extend({
         upgradeController.setDBProperty('upgradeId', lastUpgradeData.Upgrade.request_id);
         upgradeController.setDBProperty('isDowngrade', lastUpgradeData.Upgrade.direction
=== 'DOWNGRADE');
         upgradeController.setDBProperty('upgradeState', lastUpgradeData.Upgrade.request_status);
-        upgradeController.setDBProperty('upgradeVersion', lastUpgradeData.Upgrade.to_version);
+        upgradeController.setDBProperty('upgradeVersion', App.get('currentStackName') + '-'
+ lastUpgradeData.Upgrade.to_version);
       }
 
       var dbUpgradeState = App.db.get('MainAdminStackAndUpgrade', 'upgradeState');

http://git-wip-us.apache.org/repos/asf/ambari/blob/cae5552e/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 6b4b8b1..7768f1c 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
@@ -350,6 +350,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
       name: 'admin.downgrade.start',
       sender: this,
       data: {
+        from: App.RepositoryVersion.find().findProperty('displayName', this.get('upgradeVersion')).get('repositoryVersion'),
         value: currentVersion.repository_version,
         label: currentVersion.repository_name,
         isDowngrade: true

http://git-wip-us.apache.org/repos/asf/ambari/blob/cae5552e/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 1876268..2542e57 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -1532,6 +1532,7 @@ var urls = {
             "downgrade": "true"
           },
           "Upgrade": {
+            "from_version": data.from,
             "repository_version": data.value
           }
         })

http://git-wip-us.apache.org/repos/asf/ambari/blob/cae5552e/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 9450884..f456708 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
@@ -638,18 +638,31 @@ describe('App.MainAdminStackAndUpgradeController', function() {
     before(function () {
       sinon.stub(App.ajax, 'send', Em.K);
       sinon.stub(controller, 'abortUpgrade');
+      sinon.stub(App.RepositoryVersion, 'find').returns([
+        Em.Object.create({
+          displayName: 'HDP-2.3',
+          repositoryVersion: '2.3'
+        })
+      ]);
     });
     after(function () {
       App.ajax.send.restore();
       controller.abortUpgrade.restore();
+      App.RepositoryVersion.find.restore();
     });
     it("make ajax call", function() {
+      controller.set('upgradeVersion', 'HDP-2.3');
       controller.downgrade(Em.Object.create({
         repository_version: '2.2',
         repository_name: 'HDP-2.2'
       }), {context: 'context'});
       expect(controller.abortUpgrade.calledOnce).to.be.true;
-      expect(App.ajax.send.getCall(0).args[0].data).to.eql({"value": '2.2', "label": 'HDP-2.2',
isDowngrade: true});
+      expect(App.ajax.send.getCall(0).args[0].data).to.eql({
+        value: '2.2',
+        label: 'HDP-2.2',
+        from: '2.3',
+        isDowngrade: true
+      });
       expect(App.ajax.send.getCall(0).args[0].name).to.eql('admin.downgrade.start');
       expect(App.ajax.send.getCall(0).args[0].sender).to.eql(controller);
       expect(App.ajax.send.getCall(0).args[0].success).to.eql('upgradeSuccessCallback');


Mime
View raw message