ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-21375 Pass Down More Specific Repository When Creating an Upgrade. (atkach)
Date Thu, 29 Jun 2017 15:44:39 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-21348 b928e7aba -> ab85eeb19


AMBARI-21375 Pass Down More Specific Repository When Creating an Upgrade. (atkach)


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

Branch: refs/heads/branch-feature-AMBARI-21348
Commit: ab85eeb1945de81c1d9cde24747308fec179f2c9
Parents: b928e7a
Author: Andrii Tkach <atkach@apache.org>
Authored: Thu Jun 29 18:12:26 2017 +0300
Committer: Andrii Tkach <atkach@apache.org>
Committed: Thu Jun 29 18:12:26 2017 +0300

----------------------------------------------------------------------
 .../app/controllers/main/admin/stack_and_upgrade_controller.js | 1 +
 ambari-web/app/utils/ajax/ajax.js                              | 1 +
 .../views/main/admin/stack_upgrade/upgrade_version_box_view.js | 6 +++++-
 .../main/admin/stack_and_upgrade_controller_test.js            | 2 ++
 4 files changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ab85eeb1/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 5c0a88c..7ff513e 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
@@ -1310,6 +1310,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
    */
   runPreUpgradeCheck: function(version) {
     var params = {
+      id: version.get('id'),
       value: version.get('repositoryVersion'),
       label: version.get('displayName'),
       type: version.get('upgradeType'),

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab85eeb1/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 eab94bb..a952ee4 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -1709,6 +1709,7 @@ var urls = {
         timeout : 600000,
         data: JSON.stringify({
           "Upgrade": {
+            "repository_id": data.id,
             "repository_version": data.value,
             "upgrade_type": data.type,
             "skip_failures": data.skipComponentFailures,

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab85eeb1/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
index 03d0621..86034fd 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_version_box_view.js
@@ -153,6 +153,10 @@ App.UpgradeVersionBoxView = Em.View.extend({
     var statePropertiesMap = this.get('statePropertiesMap');
     var requestInProgressRepoId = this.get('controller.requestInProgressRepoId');
     var status = this.get('content.status');
+    var isVersionHigherThanCurrent = stringUtils.compareVersions(
+        this.get('content.repositoryVersion'),
+        Em.get(currentVersion, 'repository_version')
+      ) === 1;
     var element = Em.Object.create({
       status: status,
       isInstalling: function () {
@@ -172,7 +176,7 @@ App.UpgradeVersionBoxView = Em.View.extend({
     }
     else if ((status === 'INSTALLED' && !this.get('isUpgrading')) ||
              (['INSTALL_FAILED', 'OUT_OF_SYNC'].contains(status))) {
-      if (stringUtils.compareVersions(this.get('content.repositoryVersion'), Em.get(currentVersion,
'repository_version')) === 1) {
+      if (Em.get(currentVersion, 'stack_name') !== this.get('content.stackVersionType') ||
isVersionHigherThanCurrent) {
         var isDisabled = this.isDisabledOnInstalled();
         element.set('isButtonGroup', true);
         if (status === 'OUT_OF_SYNC') {

http://git-wip-us.apache.org/repos/asf/ambari/blob/ab85eeb1/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 b0e8922..f7c84e9 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
@@ -391,6 +391,7 @@ describe('App.MainAdminStackAndUpgradeController', function() {
   describe("#runPreUpgradeCheck()", function() {
     it("make ajax call", function() {
       controller.runPreUpgradeCheck(Em.Object.create({
+        id: 1,
         repositoryVersion: '2.2',
         displayName: 'HDP-2.2',
         upgradeType: 'ROLLING',
@@ -401,6 +402,7 @@ describe('App.MainAdminStackAndUpgradeController', function() {
       expect(args[0]).to.exists;
       expect(args[0].sender).to.be.eql(controller);
       expect(args[0].data).to.be.eql({
+        id: 1,
         value: '2.2',
         label: 'HDP-2.2',
         type: 'ROLLING',


Mime
View raw message