You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ak...@apache.org on 2015/06/27 20:08:59 UTC
ambari git commit: AMBARI-12184. Unable to save configs if there is
two config groups with the same property value (akovalenko)
Repository: ambari
Updated Branches:
refs/heads/trunk 0254474a0 -> d90a101c2
AMBARI-12184. Unable to save configs if there is two config groups with the same property value (akovalenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/d90a101c
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/d90a101c
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/d90a101c
Branch: refs/heads/trunk
Commit: d90a101c2db06d14336a39254e94fc7cf444cb07
Parents: 0254474
Author: Aleksandr Kovalenko <ak...@hortonworks.com>
Authored: Sat Jun 27 18:36:38 2015 +0300
Committer: Aleksandr Kovalenko <ak...@hortonworks.com>
Committed: Sat Jun 27 21:07:48 2015 +0300
----------------------------------------------------------------------
ambari-web/app/messages.js | 1 -
.../configs/objects/service_config_property.js | 45 +++++++++-----------
.../objects/service_config_property_test.js | 19 ---------
3 files changed, 20 insertions(+), 45 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/d90a101c/ambari-web/app/messages.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js
index d5c2eec..88dbcaf 100644
--- a/ambari-web/app/messages.js
+++ b/ambari-web/app/messages.js
@@ -409,7 +409,6 @@ Em.I18n.translations = {
'host.spacesValidation': 'Cannot contain whitespace',
'host.trimspacesValidation': 'Cannot contain leading or trailing whitespace',
'config.override.valueEqualToParentConfig': 'Configuration overrides must have different value',
- 'config.override.valueEqualToAnotherOverrideConfig': 'Multiple configuration overrides cannot have same value',
'services.hdfs.rebalance.title' : 'HDFS Rebalance',
'services.ganglia.description':'Ganglia Metrics Collection system',
http://git-wip-us.apache.org/repos/asf/ambari/blob/d90a101c/ambari-web/app/models/configs/objects/service_config_property.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/configs/objects/service_config_property.js b/ambari-web/app/models/configs/objects/service_config_property.js
index 089b249..e4c7e1d 100644
--- a/ambari-web/app/models/configs/objects/service_config_property.js
+++ b/ambari-web/app/models/configs/objects/service_config_property.js
@@ -481,46 +481,41 @@ App.ServiceConfigProperty = Em.Object.extend({
* @method _validateOverrides
*/
_validateOverrides: function () {
- var self = this;
var isError = false;
var value = this._getValueForCheck(this.get('value'));
var isOriginalSCP = this.get('isOriginalSCP');
var supportsFinal = this.get('supportsFinal');
var isFinal = this.get('isFinal');
var parentSCP = this.get('parentSCP');
- if (!isOriginalSCP) {
- if (!Em.isNone(parentSCP)) {
- if (value === this._getValueForCheck(parentSCP.get('value'))) {
- if (supportsFinal) {
- if (isFinal === parentSCP.get('isFinal')) {
+ var overrides = this.get('overrides');
+ if (isOriginalSCP) {
+ if (overrides) {
+ overrides.forEach(function (override) {
+ if (value === this._getValueForCheck(override.get('value'))) {
+ if (supportsFinal) {
+ if (isFinal === override.get('isFinal')) {
+ this.set('errorMessage', Em.I18n.t('config.override.valueEqualToParentConfig'));
+ isError = true;
+ }
+ }
+ else {
this.set('errorMessage', Em.I18n.t('config.override.valueEqualToParentConfig'));
isError = true;
}
}
- else {
+ }, this);
+ }
+ } else {
+ if (!Em.isNone(parentSCP) && value === this._getValueForCheck(parentSCP.get('value'))) {
+ if (supportsFinal) {
+ if (isFinal === parentSCP.get('isFinal')) {
this.set('errorMessage', Em.I18n.t('config.override.valueEqualToParentConfig'));
isError = true;
}
}
else {
- var overrides = parentSCP.get('overrides');
- if (overrides) {
- overrides.forEach(function (override) {
- if (self == override) return;
- if (value === self._getValueForCheck(override.get('value'))) {
- if (supportsFinal) {
- if (isFinal === parentSCP.get('isFinal')) {
- self.set('errorMessage', Em.I18n.t('config.override.valueEqualToAnotherOverrideConfig'));
- isError = true;
- }
- }
- else {
- self.set('errorMessage', Em.I18n.t('config.override.valueEqualToAnotherOverrideConfig'));
- isError = true;
- }
- }
- });
- }
+ this.set('errorMessage', Em.I18n.t('config.override.valueEqualToParentConfig'));
+ isError = true;
}
}
}
http://git-wip-us.apache.org/repos/asf/ambari/blob/d90a101c/ambari-web/test/models/configs/objects/service_config_property_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/models/configs/objects/service_config_property_test.js b/ambari-web/test/models/configs/objects/service_config_property_test.js
index 8541668..00cf620 100644
--- a/ambari-web/test/models/configs/objects/service_config_property_test.js
+++ b/ambari-web/test/models/configs/objects/service_config_property_test.js
@@ -531,25 +531,6 @@ describe('App.ServiceConfigProperty', function () {
}
},
{
- m: 'not original config, parent override has same value',
- e: true,
- c: {
- value: 'on',
- isOriginalSCP: false,
- supportsFinal: true,
- isFinal: false,
- parentSCP: App.ServiceConfigProperty.create({
- value: 'off',
- overrides: [
- App.ServiceConfigProperty.create({
- value: 'on',
- isOriginalSCP: false
- })
- ]
- })
- }
- },
- {
m: 'not original config, parent override doesn\'t have same value',
e: false,
c: {