ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject git commit: AMBARI-3806 Cannot save Default configs when overridden config present. (atkach)
Date Tue, 19 Nov 2013 12:49:59 GMT
Updated Branches:
  refs/heads/trunk 4ecaa001a -> b01ba5c51


AMBARI-3806 Cannot save Default configs when overridden config present. (atkach)


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

Branch: refs/heads/trunk
Commit: b01ba5c51fd19e4101a9104eb5d8d177cdd8afa0
Parents: 4ecaa00
Author: atkach <andrey91.07@gmail.com>
Authored: Tue Nov 19 14:49:54 2013 +0200
Committer: atkach <andrey91.07@gmail.com>
Committed: Tue Nov 19 14:49:54 2013 +0200

----------------------------------------------------------------------
 .../app/controllers/main/service/info/configs.js   | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/b01ba5c5/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 26d3b71..975462c 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -890,9 +890,13 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
       result.flag = this.doPUTClusterConfigurations();
     } else {
       var overridenConfigs = [];
+      var groupHosts = [];
       configs.filterProperty('isOverridden', true).forEach(function (config) {
         overridenConfigs = overridenConfigs.concat(config.get('overrides'));
       });
+      selectedConfigGroup.get('hosts').forEach(function(hostName){
+        groupHosts.push({"host_name": hostName});
+      });
 
       this.putConfigGroupChanges({
         ConfigGroup: {
@@ -901,7 +905,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
           "group_name": selectedConfigGroup.get('name'),
           "tag": selectedConfigGroup.get('service.id'),
           "description": selectedConfigGroup.get('description'),
-          "hosts": selectedConfigGroup.get('hosts'),
+          "hosts": groupHosts,
           "desired_configs": this.buildGroupDesiredConfigs(overridenConfigs)
         }
       });
@@ -967,17 +971,6 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
       if (globalConfigs.someProperty('name', uiConfigProperty.name)) {
         var modelGlobalConfig = globalConfigs.findProperty('name', uiConfigProperty.name);
         modelGlobalConfig.value = uiConfigProperty.value;
-        var uiOverrides = uiConfigProperty.get('overrides');
-        if (uiOverrides != null && uiOverrides.get('length') > 0) {
-          modelGlobalConfig.overrides = {};
-          uiOverrides.forEach(function (uiOverride) {
-            var value = uiOverride.get('value');
-            modelGlobalConfig.overrides[value] = [];
-            uiOverride.get('selectedHostOptions').forEach(function (host) {
-              modelGlobalConfig.overrides[value].push(host);
-            });
-          });
-        }
       } else {
         globalConfigs.pushObject({
           name: uiConfigProperty.name,


Mime
View raw message