You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by at...@apache.org on 2014/01/03 14:06:39 UTC

git commit: AMBARI-4219 Cannot save two config groups for different services but same config type. (atkach)

Updated Branches:
  refs/heads/trunk 48933cbdf -> 09f1c98a2


AMBARI-4219 Cannot save two config groups for different services but same config type. (atkach)


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

Branch: refs/heads/trunk
Commit: 09f1c98a23edd1a8f215552fe3b9c3e98969c300
Parents: 48933cb
Author: atkach <at...@hortonworks.com>
Authored: Fri Jan 3 15:06:35 2014 +0200
Committer: atkach <at...@hortonworks.com>
Committed: Fri Jan 3 15:06:35 2014 +0200

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/info/configs.js | 5 +++--
 ambari-web/app/controllers/wizard/step8_controller.js   | 5 ++++-
 2 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/09f1c98a/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 0bce90a..f075884 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -974,11 +974,12 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
   /**
    * construct desired_configs for config groups from overriden properties
    * @param configs
+   * @param timeTag
    * @return {Array}
    */
-  buildGroupDesiredConfigs: function (configs) {
+  buildGroupDesiredConfigs: function (configs, timeTag) {
     var sites = [];
-    var time = (new Date).getTime();
+    var time = timeTag || (new Date).getTime();
     configs.forEach(function (config) {
       var type = config.get('filename').replace('.xml', '');
       var site = sites.findProperty('type', type);

http://git-wip-us.apache.org/repos/asf/ambari/blob/09f1c98a/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 58e1e05..9089d21 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1489,6 +1489,7 @@ App.WizardStep8Controller = Em.Controller.extend({
     var sendData = [];
     var updateData = [];
     var serviceConfigController = App.router.get('mainServiceInfoConfigsController');
+    var timeTag = (new Date).getTime();
     var groupsToDelete = App.router.get(this.get('content.controllerName')).getDBProperty('groupsToDelete');
     if (groupsToDelete && groupsToDelete.length > 0) {
       this.removeInstalledServicesConfigurationGroups(groupsToDelete);
@@ -1510,7 +1511,7 @@ App.WizardStep8Controller = Em.Controller.extend({
       configGroup.properties.forEach(function (property) {
         groupConfigs.push(Em.Object.create(property));
       });
-      groupData.desired_configs = serviceConfigController.buildGroupDesiredConfigs.call(serviceConfigController, groupConfigs);
+      groupData.desired_configs = serviceConfigController.buildGroupDesiredConfigs.call(serviceConfigController, groupConfigs, timeTag);
       // check for group from installed service
       if (configGroup.isForUpdate === true) {
         // if group is a new one, create it
@@ -1524,6 +1525,8 @@ App.WizardStep8Controller = Em.Controller.extend({
       } else {
         sendData.push({"ConfigGroup": groupData});
       }
+      //each group should have unique tag to prevent overriding configs from common sites
+      timeTag++;
     }, this);
     if (sendData.length > 0) {
       this.applyConfigurationGroups(sendData);