ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexantone...@apache.org
Subject [1/2] ambari git commit: AMBARI-13000. Disable Ranger Hive Plugin is not reverting all the required properties (alexantonenko)
Date Thu, 03 Sep 2015 15:21:30 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk c3a81ca00 -> 2771d477f


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/2771d477
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/2771d477
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/2771d477

Branch: refs/heads/trunk
Commit: 2771d477fd2f2dca3f7fac350758857af7a59bd0
Parents: 2ae7e8f
Author: Alex Antonenko <hiveww@gmail.com>
Authored: Thu Sep 3 18:16:12 2015 +0300
Committer: Alex Antonenko <hiveww@gmail.com>
Committed: Thu Sep 3 18:21:24 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/2771d477/ambari-web/app/controllers/wizard.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js
index 5c4ef30..04a4dc2 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -43,7 +43,8 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
     'allHostNames',
     'installOptions',
     'allHostNamesPattern',
-    'serviceComponents'
+    'serviceComponents',
+    'fileNamesToUpdate'
   ],
 
   sensibleConfigs: [
@@ -883,7 +884,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/2771d477/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 18f6da6..c7fc3a7 100644
--- a/ambari-web/app/mixins/common/configs/enhanced_configs.js
+++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js
@@ -562,6 +562,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);
@@ -585,6 +588,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/2771d477/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 c564359..db82636 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/2771d477/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 b0750e1..f88101a 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();
     });
 


Mime
View raw message