AMBARI-21601. Web Client Should Provide Repository ID For Upgrade Checks 
(alexantonenko)


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

Branch: refs/heads/branch-2.6
Commit: a1efd2cb1c95146a631c64b6e63eaef85223b3c9
Parents: dd8d710
Author: Alex Antonenko <aantone...@hortonworks.com>
Authored: Fri Jul 28 17:31:14 2017 +0300
Committer: Alex Antonenko <aantone...@hortonworks.com>
Committed: Fri Jul 28 17:31:14 2017 +0300

----------------------------------------------------------------------
 .../controllers/main/admin/stack_and_upgrade_controller.js   | 8 ++++----
 ambari-web/app/utils/ajax/ajax.js                            | 2 +-
 .../main/admin/stack_and_upgrade_controller_test.js          | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a1efd2cb/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 372a811..e02a4c2 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
@@ -937,7 +937,7 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
     this.get('upgradeMethods').forEach(function (method) {
       if (method.get('allowed')) {
         this.runPreUpgradeCheckOnly({
-          value: version.get('repositoryVersion'),
+          value: version.get('id'),
           label: version.get('displayName'),
           type: method.get('type'),
           targetStack: version.get('displayName')
@@ -1058,7 +1058,7 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
         },
         rerunCheck: function (event) {
           self.runPreUpgradeCheckOnly({
-            value: version.get('repositoryVersion'),
+            value: version.get('id'),
             label: version.get('displayName'),
             type: event.context.get('type'),
             targetStack: version.get('displayName')
@@ -1095,7 +1095,7 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
             bypassedFailures: bypassedFailures,
             callback: function () {
               self.runPreUpgradeCheckOnly.call(self, {
-                value: version.get('repositoryVersion'),
+                value: version.get('id'),
                 label: version.get('displayName'),
                 type: event.context.get('type'),
                 targetStack: version.get('displayName')
@@ -1329,7 +1329,7 @@ App.MainAdminStackAndUpgradeController = 
Em.Controller.extend(App.LocalStorage,
   runPreUpgradeCheck: function(version) {
     var params = {
       id: version.get('id'),
-      value: version.get('repositoryVersion'),
+      value: version.get('id'),
       label: version.get('displayName'),
       type: version.get('upgradeType'),
       skipComponentFailures: version.get('skipComponentFailures') ? 'true' : 
'false',

http://git-wip-us.apache.org/repos/asf/ambari/blob/a1efd2cb/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 8f07bb6..7080829 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -1859,7 +1859,7 @@ var urls = {
   },
 
   'admin.upgrade.pre_upgrade_check': {
-    'real': 
'/clusters/{clusterName}/rolling_upgrades_check?fields=*&UpgradeChecks/repository_version={value}&UpgradeChecks/upgrade_type={type}&UpgradeChecks/target_stack={targetStack}',
+    'real': 
'/clusters/{clusterName}/rolling_upgrades_check?fields=*&UpgradeChecks/repository_version_id={value}&UpgradeChecks/upgrade_type={type}&UpgradeChecks/target_stack={targetStack}',
     'mock': '/data/stack_versions/pre_upgrade_check.json'
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/a1efd2cb/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 a4a9a69..fd90ae7 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
@@ -403,7 +403,7 @@ describe('App.MainAdminStackAndUpgradeController', 
function() {
       expect(args[0].sender).to.be.eql(controller);
       expect(args[0].data).to.be.eql({
         id: '1',
-        value: '2.2',
+        value: '1',
         label: 'HDP-2.2',
         type: 'ROLLING',
         targetStack: 'HDP-2.2',
@@ -1752,11 +1752,11 @@ describe('App.MainAdminStackAndUpgradeController', 
function() {
     it("Rolling method allowed", function () {
       controller.get('upgradeMethods').setEach('allowed', true);
       controller.runUpgradeMethodChecks(Em.Object.create({
-        repositoryVersion: 'v1',
+        id: '1',
         displayName: 'V1'
       }));
       expect(controller.runPreUpgradeCheckOnly.calledWith({
-        value: 'v1',
+        value: '1',
         label: 'V1',
         type: 'ROLLING',
         targetStack: 'V1'

Reply via email to