浏览代码

AMBARI-3819. Adding hosts to a config-group erases tags and vice-versa. (srimanth)

Srimanth Gunturi 11 年之前
父节点
当前提交
15d4ebdef0

+ 5 - 0
ambari-web/app/controllers/main/service/manage_config_groups_controller.js

@@ -84,7 +84,12 @@ App.ManageConfigGroupsController = Em.Controller.extend({
         });
         usedHosts = usedHosts.concat(newConfigGroup.get('hosts'));
         configGroups.push(newConfigGroup);
+        var newConfigGroupSiteTags = newConfigGroup.get('configSiteTags');
         configGroup.desired_configs.forEach(function (config) {
+          newConfigGroupSiteTags.push(App.ConfigSiteTag.create({
+            site: config.type,
+            tag: config.tag
+          }));
           if (!groupToTypeToTagMap[configGroup.group_name]) {
             groupToTypeToTagMap[configGroup.group_name] = {}
           }

+ 2 - 2
ambari-web/app/utils/config.js

@@ -1162,8 +1162,8 @@ App.config = Em.Object.create({
     });
     configGroup.get('configSiteTags').forEach(function(cst){
       putConfigGroup.ConfigGroup.desired_configs.push({
-        type: cst.type,
-        tag: cst.tag
+        type: cst.get('site'),
+        tag: cst.get('tag')
       });
     });