Browse Source

AMBARI-11683 RU: Configs merge check popup is displayed even if there are no conflict. (ababiichuk)

aBabiichuk 10 years ago
parent
commit
b3ed806114

+ 2 - 2
ambari-web/app/controllers/main/admin/stack_and_upgrade_controller.js

@@ -459,9 +459,9 @@ App.MainAdminStackAndUpgradeController = Em.Controller.extend(App.LocalStorage,
       var title = Em.I18n.t('popup.clusterCheck.Upgrade.title');
       var alert = Em.I18n.t('popup.clusterCheck.Upgrade.alert');
       App.showClusterCheckPopup(data, header, title, alert);
-    } else if (data.items.someProperty('UpgradeChecks.status', "WARNING") && data.items.someProperty('UpgradeChecks.id', "CONFIG_MERGE")) {
+    } else if (data.items.someProperty('UpgradeChecks.id', "CONFIG_MERGE") && Em.get(data.items.findProperty('UpgradeChecks.id', "CONFIG_MERGE"), 'UpgradeChecks.status') == 'WARNING') {
       var self = this,
-        configsMergeCheckData = data.items.findProperty('UpgradeChecks.id', "CONFIG_MERGE").UpgradeChecks.failed_detail;
+        configsMergeCheckData = Em.get(data.items.findProperty('UpgradeChecks.id', "CONFIG_MERGE"), 'UpgradeChecks.failed_detail');
       this.set('requestInProgress', false);
       App.showUpgradeConfigsMergePopup(configsMergeCheckData, params.label, function () {
         self.upgrade(params);

+ 16 - 1
ambari-web/test/controllers/main/admin/stack_and_upgrade_controller_test.js

@@ -279,7 +279,22 @@ describe('App.MainAdminStackAndUpgradeController', function() {
         showClusterCheckPopupCalledCount: 0,
         showUpgradeConfigsMergePopupCalledCount: 1,
         upgradeCalledCount: 0,
-        title: 'warnings popup is displayed is configs merge conflicts are present'
+        title: 'warnings popup is displayed if configs merge conflicts are present'
+      },
+      {
+        check: {
+          "check": "Configuration Merge Check",
+          "status": "PASS",
+          "reason": "",
+          "failed_on": [],
+          "failed_detail": [],
+          "check_type": "CLUSTER",
+          "id": "CONFIG_MERGE"
+        },
+        showClusterCheckPopupCalledCount: 0,
+        showUpgradeConfigsMergePopupCalledCount: 0,
+        upgradeCalledCount: 1,
+        title: 'upgrade is started if configs merge conflicts are absent'
       },
       {
         check: {