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 2014/11/06 17:44:23 UTC

git commit: AMBARI-8184 Comparing identical config versions created by rollback for a new config group shows incorrect differences. (ababiichuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk a9092f990 -> e50d850ce


AMBARI-8184 Comparing identical config versions created by rollback for a new config group shows incorrect differences. (ababiichuk)


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

Branch: refs/heads/trunk
Commit: e50d850cecc1c7c8bbc5c1c384dec4c29c185147
Parents: a9092f9
Author: aBabiichuk <ab...@cybervisiontech.com>
Authored: Thu Nov 6 18:02:25 2014 +0200
Committer: aBabiichuk <ab...@cybervisiontech.com>
Committed: Thu Nov 6 18:43:19 2014 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/info/configs.js | 6 +++---
 ambari-web/app/models/service_config.js                 | 3 ++-
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e50d850c/ambari-web/app/controllers/main/service/info/configs.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/configs.js b/ambari-web/app/controllers/main/service/info/configs.js
index a2465c2..bf31a0e 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -771,8 +771,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
    * @return {Boolean}
    */
   hasCompareDiffs: function (originalConfig, compareConfig) {
-    return (originalConfig.value !== compareConfig.value) ||
-    (originalConfig.isFinal !== (compareConfig.isFinal == true));
+    return (originalConfig.value !== compareConfig.value) || (!!originalConfig.isFinal !== (compareConfig.isFinal == true));
   },
 
   /**
@@ -1195,6 +1194,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
       }
       parentOverridesArray.pushObject(newSCP);
       serviceConfigProperty.set('overrideValues', parentOverridesArray.mapProperty('value'));
+      serviceConfigProperty.set('overrideIsFinalValues', parentOverridesArray.mapProperty('isFinal'));
       console.debug("createOverrideProperty(): Added override to main-property:", serviceConfigProperty.get('name'));
     }, this);
   },
@@ -1599,7 +1599,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend(App.ServerValidatorM
   buildGroupDesiredConfigs: function (configs, timeTag) {
     var sites = [];
     var time = timeTag || (new Date).getTime();
-    var siteFileNames = configs.mapProperty('filename');
+    var siteFileNames = configs.mapProperty('filename').uniq();
     sites = siteFileNames.map(function (filename) {
       return {
         type: filename.replace('.xml', ''),

http://git-wip-us.apache.org/repos/asf/ambari/blob/e50d850c/ambari-web/app/models/service_config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/models/service_config.js b/ambari-web/app/models/service_config.js
index e94de00..d652410 100644
--- a/ambari-web/app/models/service_config.js
+++ b/ambari-web/app/models/service_config.js
@@ -224,7 +224,8 @@ App.ServiceConfigProperty = Ember.Object.extend({
   }.property('overrides', 'overrides.length', 'isOriginalSCP'),
   isOverrideChanged: function () {
     if (Em.isNone(this.get('overrides')) && this.get('overrideValues.length') === 0) return false;
-    return JSON.stringify(this.get('overrides').mapProperty('value')) !== JSON.stringify(this.get('overrideValues'));
+    return JSON.stringify(this.get('overrides').mapProperty('isFinal')) !== JSON.stringify(this.get('overrideIsFinalValues'))
+      || JSON.stringify(this.get('overrides').mapProperty('value')) !== JSON.stringify(this.get('overrideValues'));
   }.property('isOverridden', 'overrides.@each.isNotDefaultValue'),
   isRemovable: function() {
     var isOriginalSCP = this.get('isOriginalSCP');