ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlun...@apache.org
Subject [35/50] [abbrv] ambari git commit: AMBARI-22047. Cannot upgrade stack due to 'Version XXXXX does not contain services that are installed' (alexantonenko)
Date Tue, 26 Sep 2017 05:20:26 GMT
AMBARI-22047. Cannot upgrade stack due to 'Version XXXXX does not contain services that are
installed' (alexantonenko)


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

Branch: refs/heads/branch-feature-AMBARI-14714
Commit: 06d21bb3850d2f8257c08064ab9d695d2a4c07c1
Parents: 12abba0
Author: Alex Antonenko <aantonenko@hortonworks.com>
Authored: Mon Sep 25 13:55:39 2017 +0300
Committer: Alex Antonenko <aantonenko@hortonworks.com>
Committed: Mon Sep 25 13:55:39 2017 +0300

----------------------------------------------------------------------
 .../main/admin/stack_and_upgrade_controller.js  |  2 +-
 .../admin/stack_and_upgrade_controller_test.js  | 24 +++++++++++++++++---
 2 files changed, 22 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/06d21bb3/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 6d7560b..90a4db9 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
@@ -1513,7 +1513,7 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
     var availableServices = repo.get('stackServices').filter(function(service) {
       return App.Service.find(service.get('name')).get('isLoaded') && service.get('isAvailable')
&& service.get('isUpgradable');
     }, this);
-    if (!availableServices.length){
+    if (!availableServices.length && !repo.get('isStandard')){
       return App.showAlertPopup( Em.I18n.t('admin.stackVersions.upgrade.installPackage.fail.title'),
Em.I18n.t('admin.stackVersions.upgrade.installPackage.fail.noAvailableServices').format(repo.get('displayName'))
);
     }
     var self = this;

http://git-wip-us.apache.org/repos/asf/ambari/blob/06d21bb3/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 d0671f9..1b04b17 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
@@ -1170,18 +1170,36 @@ describe('App.MainAdminStackAndUpgradeController', function() {
   describe("#installRepoVersionPopup()", function () {
     before(function () {
       sinon.stub(controller, 'installRepoVersion', Em.K);
-      sinon.stub(App.Service, 'find').returns({});
+      sinon.stub(App.Service, 'find').returns(Em.Object.create({
+        isLoaded: true
+      }));
     });
     after(function () {
       controller.installRepoVersion.restore();
       App.Service.find.restore();
     });
-    it("show popup", function () {
-      var repo = Em.Object.create({'displayName': 'HDP-2.2', stackServices: []});
+    it("show confirmation popup for non standart and available services", function () {
+      var repo = Em.Object.create({'displayName': 'HDP-2.2', isStandard: false, stackServices:
[Em.Object.create({
+        name: 'HDFS',
+        isUpgradable: true,
+        isAvailable: true
+      })]});
+      var popup = controller.installRepoVersionPopup(repo);
+      popup.onPrimary();
+      expect(controller.installRepoVersion.calledWith(repo)).to.be.true;
+    });
+    it("show pre-check popup for non standard and empty available services", function ()
{
+      var repo = Em.Object.create({'displayName': 'HDP-2.2', isStandard: false, stackServices:
[]});
       var popup = controller.installRepoVersionPopup(repo);
       popup.onPrimary();
       expect(controller.installRepoVersion.calledWith(repo)).to.be.false;
     });
+    it("show confirmation popup for standart", function () {
+      var repo = Em.Object.create({'displayName': 'HDP-2.2', isStandard: true, stackServices:
[]});
+      var popup = controller.installRepoVersionPopup(repo);
+      popup.onPrimary();
+      expect(controller.installRepoVersion.calledWith(repo)).to.be.true;
+    });
   });
 
   describe("#installRepoVersion()", function () {


Mime
View raw message