You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ab...@apache.org on 2015/09/10 10:56:54 UTC
ambari git commit: AMBARI-13053 Properties overwritten without
warning when adding new Service in Ambari. (ababiichuk)
Repository: ambari
Updated Branches:
refs/heads/trunk ecdab4971 -> 9659891e6
AMBARI-13053 Properties overwritten without warning when adding new Service in Ambari. (ababiichuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9659891e
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9659891e
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9659891e
Branch: refs/heads/trunk
Commit: 9659891e6da5619bdf415d4efdec9dbf8fca1c36
Parents: ecdab49
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Thu Sep 10 11:48:33 2015 +0300
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Thu Sep 10 11:56:35 2015 +0300
----------------------------------------------------------------------
ambari-web/app/controllers/wizard.js | 2 +-
ambari-web/app/controllers/wizard/step7_controller.js | 6 ++----
ambari-web/app/controllers/wizard/step8_controller.js | 2 +-
.../app/mixins/common/configs/enhanced_configs.js | 4 ++--
ambari-web/test/controllers/wizard/step7_test.js | 12 ++++++------
5 files changed, 12 insertions(+), 14 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/9659891e/ambari-web/app/controllers/wizard.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js
index 04a4dc2..4d4eff7 100644
--- a/ambari-web/app/controllers/wizard.js
+++ b/ambari-web/app/controllers/wizard.js
@@ -916,7 +916,7 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM
// get only modified configs
var configs = _content.get('configs').filter(function (config) {
if (config.get('isNotDefaultValue') || (config.get('savedValue') === null)) {
- return !notAllowed.contains(config.get('displayType')) && !!config.filename;
+ return !notAllowed.contains(config.get('displayType')) && !!config.filename && config.isRequiredByAgent!== false;
}
return false;
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/9659891e/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 10088fd..90bef77 100644
--- a/ambari-web/app/controllers/wizard/step7_controller.js
+++ b/ambari-web/app/controllers/wizard/step7_controller.js
@@ -587,7 +587,7 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
resolveYarnConfigs: function (configs) {
var cfgToChange = configs.findProperty('name', 'hadoop.registry.rm.enabled');
if (cfgToChange) {
- var res = this.get('allSelectedServiceNames').contains('SLIDER');
+ var res = this.get('allSelectedServiceNames').contains('SLIDER').toString();
if (Em.get(cfgToChange, 'value') !== res) {
Em.set(cfgToChange, 'recommendedValue', res);
Em.set(cfgToChange, 'value', res);
@@ -895,7 +895,6 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
var configsMap = {};
var configMixin = App.get('config');
var nonServiceTab = require('data/service_configs');
- var self = this;
configsByTags.forEach(function (configSite) {
configsMap[configSite.type] = configSite.properties || {};
@@ -908,9 +907,8 @@ App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.E
if (_config.savedValue != mappedConfigValue || _config.displayType == 'password') {
_config.value = App.config.formatPropertyValue(_config, mappedConfigValue);
}
- _config.savedValue = mappedConfigValue;
+ _config.savedValue = App.config.formatPropertyValue(_config, mappedConfigValue);
_config.hasInitialValue = true;
- App.config.handleSpecialProperties(_config);
delete configsMap[type][_config.name];
}
});
http://git-wip-us.apache.org/repos/asf/ambari/blob/9659891e/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index dff09a8..deb436e 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1756,7 +1756,7 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz
installedAndSelectedServices.pushObjects(this.get('installedServices'));
installedAndSelectedServices.pushObjects(this.get('selectedServices'));
var coreSiteObj = this.get('configs').filterProperty('filename', 'core-site.xml'),
- coreSiteProperties = this.resolveProxyuserDependecies(coreSiteObj, installedAndSelectedServices),
+ coreSiteProperties = this.createSiteObj('core-site', 'version1').properties,
isGLUSTERFSSelected = installedAndSelectedServices.someProperty('serviceName', 'GLUSTERFS');
coreSiteObj.forEach(function (_coreSiteObj) {
http://git-wip-us.apache.org/repos/asf/ambari/blob/9659891e/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 a6be130..e1fd598 100644
--- a/ambari-web/app/mixins/common/configs/enhanced_configs.js
+++ b/ambari-web/app/mixins/common/configs/enhanced_configs.js
@@ -579,7 +579,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
var stackProperty = stackConfigsMap[App.config.configId(propertyName, siteName)];
var attributes = properties[propertyName] || {};
Em.keys(attributes).forEach(function (attributeName) {
- if (attributeName == 'delete') {
+ if (attributeName == 'delete' && cp) {
if (!updateOnlyBoundaries) {
var fileName = App.config.getOriginalFileName(siteName);
var modifiedFileNames = self.get('modifiedFileNames');
@@ -608,7 +608,7 @@ App.EnhancedConfigsMixin = Em.Mixin.create({
}
if (modifiedFileNames && !modifiedFileNames.contains(fileName)) {
modifiedFileNames.push(fileName);
- } else if (wizardController) {
+ } else if (wizardController && App.StackService.find(service.get('serviceName')).get('isInstalled')) {
if (!fileNamesToUpdate.contains(fileName)) {
fileNamesToUpdate.push(fileName);
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/9659891e/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 39aef78..8bf9ca7 100644
--- a/ambari-web/test/controllers/wizard/step7_test.js
+++ b/ambari-web/test/controllers/wizard/step7_test.js
@@ -646,10 +646,10 @@ describe('App.InstallerStep7Controller', function () {
it('should set property to true', function () {
var allSelectedServiceNames = ['SLIDER', 'YARN'],
configs = [
- {name: 'hadoop.registry.rm.enabled', value: false, recommendedValue: false}
+ {name: 'hadoop.registry.rm.enabled', value: 'false', recommendedValue: 'false'}
],
expected = [
- {name: 'hadoop.registry.rm.enabled', value: true, recommendedValue: true}
+ {name: 'hadoop.registry.rm.enabled', value: 'true', recommendedValue: 'true'}
];
installerStep7Controller.reopen({allSelectedServiceNames: allSelectedServiceNames});
installerStep7Controller.resolveYarnConfigs(configs);
@@ -659,10 +659,10 @@ describe('App.InstallerStep7Controller', function () {
it('should set property to false', function () {
var allSelectedServiceNames = ['YARN'],
configs = [
- {name: 'hadoop.registry.rm.enabled', value: true, recommendedValue: true}
+ {name: 'hadoop.registry.rm.enabled', value: 'true', recommendedValue: 'true'}
],
expected = [
- {name: 'hadoop.registry.rm.enabled', value: false, recommendedValue: false}
+ {name: 'hadoop.registry.rm.enabled', value: 'false', recommendedValue: 'false'}
];
installerStep7Controller.reopen({allSelectedServiceNames: allSelectedServiceNames});
installerStep7Controller.resolveYarnConfigs(configs);
@@ -672,10 +672,10 @@ describe('App.InstallerStep7Controller', function () {
it('should skip setting property', function () {
var allSelectedServiceNames = ['YARN', 'SLIDER'],
configs = [
- {name: 'hadoop.registry.rm.enabled', value: true, recommendedValue: true}
+ {name: 'hadoop.registry.rm.enabled', value: 'true', recommendedValue: 'true'}
],
expected = [
- {name: 'hadoop.registry.rm.enabled', value: true, recommendedValue: true}
+ {name: 'hadoop.registry.rm.enabled', value: 'true', recommendedValue: 'true'}
];
installerStep7Controller.reopen({allSelectedServiceNames: allSelectedServiceNames});
installerStep7Controller.resolveYarnConfigs(configs);