Updated Branches:
  refs/heads/branch-1.4.3 4aaf63aa0 -> 5f4f34773

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/5f4f3477
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/5f4f3477
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/5f4f3477

Branch: refs/heads/branch-1.4.3
Commit: 5f4f3477369d8bba56c8211ac41f1d5aaa48cdf6
Parents: 4aaf63a
Author: atkach <[email protected]>
Authored: Fri Jan 3 15:07:35 2014 +0200
Committer: atkach <[email protected]>
Committed: Fri Jan 3 15:07:45 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/5f4f3477/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 4825654..e89ee2f 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/5f4f3477/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 7889cfa..3569444 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -1481,6 +1481,7 @@ App.WizardStep8Controller = Em.Controller.extend({
     var clusterName = this.get('clusterName');
     var sendData = [];
     var serviceConfigController = 
App.router.get('mainServiceInfoConfigsController');
+    var timeTag = (new Date).getTime();
     configGroups.forEach(function (configGroup) {
       var groupConfigs = [];
       var groupData = {
@@ -1498,8 +1499,10 @@ 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);
       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);

Reply via email to