You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by al...@apache.org on 2015/09/03 17:24:04 UTC

ambari git commit: AMBARI-13000. Disable Ranger Hive Plugin is not reverting all the required properties (alexantonenko)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 09c79f31b -> 61ee2abe7


AMBARI-13000. Disable Ranger Hive Plugin is not reverting all the required properties (alexantonenko)


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

Branch: refs/heads/branch-2.1
Commit: 61ee2abe7d3a3f6c9ff329bb42da6712682c2e1d
Parents: 09c79f3
Author: Alex Antonenko <hi...@gmail.com>
Authored: Thu Sep 3 18:16:12 2015 +0300
Committer: Alex Antonenko <hi...@gmail.com>
Committed: Thu Sep 3 18:23:57 2015 +0300

----------------------------------------------------------------------
 ambari-web/app/controllers/wizard.js                   |  5 +++--
 .../app/mixins/common/configs/enhanced_configs.js      | 12 ++++++++++++
 .../common/configs/service_configs_by_category_view.js | 13 ++++++++++++-
 ambari-web/test/controllers/wizard_test.js             |  2 ++
 4 files changed, 29 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/61ee2abe/ambari-web/app/controllers/wizard.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js
index 0ce3e95..861b2ad 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -42,7 +42,8 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
     'allHostNames',
     'installOptions',
     'allHostNamesPattern',
-    'serviceComponents'
+    'serviceComponents',
+    'fileNamesToUpdate'
   ],
 
   sensibleConfigs: [
@@ -855,7 +856,7 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
    */
   saveServiceConfigProperties: function (stepController) {
     var serviceConfigProperties = [];
-    var fileNamesToUpdate = [];
+    var fileNamesToUpdate = this.getDBProperty('fileNamesToUpdate') || [];
     var installedServiceNames = stepController.get('installedServiceNames') || [];
     var installedServiceNamesMap = {};
     var notAllowed = ['masterHost', 'masterHosts', 'slaveHosts', 'slaveHost'];

http://git-wip-us.apache.org/repos/asf/ambari/blob/61ee2abe/ambari-web/app/mixins/common/configs/enhanced_configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/mixins/common/configs/enhanced_configs.js b/ambari-web/app/mixins/common/configs/enhanced_configs.js
index fb19309..5794e75 100644
--- a/ambari-web/app/mixins/common/configs/enhanced_configs.js
+++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js
@@ -561,6 +561,9 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
         Em.keys(attributes).forEach(function (attributeName) {
           if (attributeName == 'delete') {
             if (!updateOnlyBoundaries) {
+              var fileName = App.config.getOriginalFileName(siteName);
+              var modifiedFileNames = self.get('modifiedFileNames');
+              var wizardController = self.get('wizardController');
               var dependentProperty = self.get('_dependentConfigValues').filterProperty('propertyName', propertyName).filterProperty('fileName', siteName).findProperty('configGroup', group && Em.get(group,'name'));
               if (dependentProperty) {
                 Em.set(dependentProperty, 'toDelete', true);
@@ -584,6 +587,15 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
                   recommendedValue: null
                 });
               }
+              if (modifiedFileNames && !modifiedFileNames.contains(fileName)) {
+               modifiedFileNames.push(fileName);
+              } else if (wizardController) {
+                var fileNamesToUpdate = wizardController.getDBProperty('fileNamesToUpdate') || [];
+                if (!fileNamesToUpdate.contains(fileName)) {
+                  fileNamesToUpdate.push(fileName);
+                  wizardController.setDBProperty('fileNamesToUpdate', fileNamesToUpdate);
+                }
+              }
             }
           } else if (stackProperty) {
             if (selectedConfigGroup) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/61ee2abe/ambari-web/app/views/common/configs/service_configs_by_category_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/service_configs_by_category_view.js b/ambari-web/app/views/common/configs/service_configs_by_category_view.js
index 5996579..ea2226e 100644
--- a/ambari-web/app/views/common/configs/service_configs_by_category_view.js
+++ b/ambari-web/app/views/common/configs/service_configs_by_category_view.js
@@ -580,7 +580,18 @@ App.ServiceConfigsByCategoryView = Em.View.extend(App.UserPref, App.ConfigOverri
     }
     // push config's file name if this config was stored on server
     if (!serviceConfigProperty.get('isNotSaved')) {
-      this.get('controller').get('modifiedFileNames').push(serviceConfigProperty.get('filename'));
+      var modifiedFileNames = this.get('controller.modifiedFileNames'),
+        wizardController = this.get('controller.wizardController'),
+        filename = serviceConfigProperty.get('filename');
+      if (modifiedFileNames && !modifiedFileNames.contains(filename)) {
+        modifiedFileNames.push(serviceConfigProperty.get('filename'));
+      } else if (wizardController) {
+        var fileNamesToUpdate = wizardController.getDBProperty('fileNamesToUpdate') || [];
+        if (!fileNamesToUpdate.contains(filename)) {
+          fileNamesToUpdate.push(filename);
+          wizardController.setDBProperty('fileNamesToUpdate', fileNamesToUpdate);
+        }
+      }
     }
     Em.$('body>.tooltip').remove(); //some tooltips get frozen when their owner's DOM element is removed
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/61ee2abe/ambari-web/test/controllers/wizard_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/controllers/wizard_test.js b/ambari-web/test/controllers/wizard_test.js
index 2bf1a97..035e0ab 100644
--- a/ambari-web/test/controllers/wizard_test.js
+++ b/ambari-web/test/controllers/wizard_test.js
@@ -914,11 +914,13 @@ describe('App.WizardController', function () {
     beforeEach(function () {
       c.set('content', {});
       sinon.stub(c, 'setDBProperties', Em.K);
+      sinon.stub(c, 'getDBProperty').withArgs('fileNamesToUpdate').returns([]);
       sinon.stub(App.config, 'shouldSupportFinal').returns(true);
     });
 
     afterEach(function () {
       c.setDBProperties.restore();
+      c.getDBProperty.restore();
       App.config.shouldSupportFinal.restore();
     });