Repository: ambari Updated Branches: refs/heads/branch-2.1 f8635b05a -> da745f764
AMBARI-14174 Add Ranger KMS: Other services are incorrectly reconfigured. (atkach) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/da745f76 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/da745f76 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/da745f76 Branch: refs/heads/branch-2.1 Commit: da745f7641a4c15d4256c9e420093bd13f084b7f Parents: f8635b0 Author: Andrii Tkach <atk...@hortonworks.com> Authored: Thu Dec 3 12:03:31 2015 +0200 Committer: Andrii Tkach <atk...@hortonworks.com> Committed: Thu Dec 3 12:09:46 2015 +0200 ---------------------------------------------------------------------- .../2.2/services/TEZ/configuration/tez-site.xml | 5 +++ .../app/controllers/wizard/step7_controller.js | 44 +++++++++++--------- .../mixins/common/configs/enhanced_configs.js | 2 +- .../test/controllers/wizard/step7_test.js | 16 +------ 4 files changed, 31 insertions(+), 36 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/da745f76/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml b/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml index 33920d6..813e535 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml +++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/TEZ/configuration/tez-site.xml @@ -342,4 +342,9 @@ </description> </property> + <property> + <name>tez.tez-ui.history-url.base</name> + <description></description> + </property> + </configuration> http://git-wip-us.apache.org/repos/asf/ambari/blob/da745f76/ambari-web/app/controllers/wizard/step7_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js index 84142d7..af97f54 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -645,7 +645,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E this.set('groupsToDelete', this.get('wizardController').getDBProperty('groupsToDelete') || []); if (this.get('wizardController.name') === 'addServiceController') { App.router.get('configurationController').getConfigsByTags(this.get('serviceConfigTags')).done(function (loadedConfigs) { - self.setInstalledServiceConfigs(self.get('serviceConfigTags'), configs, loadedConfigs, self.get('installedServiceNames')); + configs = self.setInstalledServiceConfigs(configs, loadedConfigs, self.get('installedServiceNames')); self.applyServicesConfigs(configs, storedConfigs); }); } else { @@ -717,7 +717,6 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E if (self.get('wizardController.name') == 'addServiceController') { // for Add Service just remove or add dependent properties and ignore config values changes // for installed services only - self.addRemoveDependentConfigs(self.get('installedServiceNames')); self.clearDependenciesForInstalledServices(self.get('installedServiceNames'), self.get('stepConfigs')); } // * add dependencies based on recommendations @@ -1030,46 +1029,51 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E /** * set configs actual values from server - * @param serviceConfigTags * @param configs * @param configsByTags * @param installedServiceNames * @method setInstalledServiceConfigs */ - setInstalledServiceConfigs: function (serviceConfigTags, configs, configsByTags, installedServiceNames) { + setInstalledServiceConfigs: function (configs, configsByTags, installedServiceNames) { var configsMap = {}; - var configMixin = App.get('config'); - var nonServiceTab = require('data/service_configs'); configsByTags.forEach(function (configSite) { configsMap[configSite.type] = configSite.properties || {}; }); - configs.forEach(function (_config) { - var type = _config.filename ? App.config.getConfigTagFromFileName(_config.filename) : null; - var mappedConfigValue = type && configsMap[type] ? configsMap[type][_config.name] : null; - if (!Em.isNone(mappedConfigValue) && ((installedServiceNames && installedServiceNames.contains(_config.serviceName) || nonServiceTab.someProperty('serviceName', _config.serviceName)))) { - // prevent overriding already edited properties - if (_config.savedValue != mappedConfigValue || _config.displayType == 'password') { + var allConfigs = configs.filter(function (_config) { + if ((['MISC'].concat(installedServiceNames).contains(_config.serviceName))) { + var type = _config.filename ? App.config.getConfigTagFromFileName(_config.filename) : null; + var mappedConfigValue = type && configsMap[type] ? configsMap[type][_config.name] : null; + if (Em.isNone(mappedConfigValue)) { + //for now ranger plugin properties are not sending by recommendations if they are missed - it should be added + return _config.serviceName == 'MISC' || /^ranger-/.test(_config.filename); + } else { + if (_config.savedValue != mappedConfigValue) { + _config.savedValue = App.config.formatPropertyValue(_config, mappedConfigValue); + } _config.value = App.config.formatPropertyValue(_config, mappedConfigValue); + _config.hasInitialValue = true; + delete configsMap[type][_config.name]; + return true; } - _config.savedValue = App.config.formatPropertyValue(_config, mappedConfigValue); - _config.hasInitialValue = true; - delete configsMap[type][_config.name]; + } else { + return true; } - }); + }, this); //add user properties Em.keys(configsMap).forEach(function (filename) { Em.keys(configsMap[filename]).forEach(function (propertyName) { - configs.push(configMixin.createDefaultConfig(propertyName, - configMixin.getServiceByConfigType(filename) ? configMixin.getServiceByConfigType(filename).get('serviceName') : 'MISC', - configMixin.getOriginalFileName(filename), + allConfigs.push(App.config.createDefaultConfig(propertyName, + App.config.getServiceByConfigType(filename) ? App.config.getServiceByConfigType(filename).get('serviceName') : 'MISC', + App.config.getOriginalFileName(filename), false, { value: configsMap[filename][propertyName], savedValue: configsMap[filename][propertyName], hasInitialValue: true - })); + })); }); }); + return allConfigs; }, /** http://git-wip-us.apache.org/repos/asf/ambari/blob/da745f76/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 23f14ea..233bd16 100644 --- a/ambari-web/app/mixins/common/configs/enhanced_configs.js +++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js @@ -187,7 +187,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({ return p && p.concat(c); }); var cleanDependencies = this.get('_dependentConfigValues').reject(function(item) { - if ('hadoop.proxyuser'.contains(Em.get(item, 'name'))) return false; + if (Em.get(item, 'propertyName').contains('hadoop.proxyuser')) return false; if (installedServices.contains(Em.get(item, 'serviceName'))) { var stackProperty = App.StackConfigProperty.find(App.config.configId(item.propertyName, item.fileName)); var parentConfigs = stackProperty && stackProperty.get('propertyDependsOn'); http://git-wip-us.apache.org/repos/asf/ambari/blob/da745f76/ambari-web/test/controllers/wizard/step7_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/controllers/wizard/step7_test.js b/ambari-web/test/controllers/wizard/step7_test.js index 89632c5..a39dca3 100644 --- a/ambari-web/test/controllers/wizard/step7_test.js +++ b/ambari-web/test/controllers/wizard/step7_test.js @@ -1649,20 +1649,6 @@ describe('App.InstallerStep7Controller', function () { var controller = App.WizardStep7Controller.create({ installedServiceNames: ['HBASE', 'AMBARI_METRICS'] }), - serviceConfigTags = [ - { - siteName: 'hbase-site', - tagName: 'version1' - }, - { - siteName: 'ams-hbase-site', - tagName: 'version1' - }, - { - siteName: 'site-without-properties', - tagName: 'version1' - } - ], configs = [ { name: 'hbase.client.scanner.caching', @@ -1700,7 +1686,7 @@ describe('App.InstallerStep7Controller', function () { installedServiceNames = ['HBASE', 'AMBARI_METRICS']; it('should handle properties with the same name', function () { - controller.setInstalledServiceConfigs(serviceConfigTags, configs, configsByTags, installedServiceNames); + configs = controller.setInstalledServiceConfigs(configs, configsByTags, installedServiceNames); var properties = configs.filterProperty('name', 'hbase.client.scanner.caching'); expect(properties).to.have.length(2); expect(properties.findProperty('filename', 'hbase-site.xml').value).to.equal('1500');