|
@@ -280,7 +280,8 @@ App.config = Em.Object.create({
|
|
* @returns {Object}
|
|
* @returns {Object}
|
|
*/
|
|
*/
|
|
createDefaultConfig: function(name, fileName, definedInStack, coreObject) {
|
|
createDefaultConfig: function(name, fileName, definedInStack, coreObject) {
|
|
- var serviceName = this.get('serviceByConfigTypeMap')[fileName] || 'MISC';
|
|
|
|
|
|
+ var service = this.get('serviceByConfigTypeMap')[App.config.getConfigTagFromFileName(fileName)];
|
|
|
|
+ var serviceName = service ? service.get('serviceName') : 'MISC';
|
|
var tpl = {
|
|
var tpl = {
|
|
/** core properties **/
|
|
/** core properties **/
|
|
id: this.configId(name, fileName),
|
|
id: this.configId(name, fileName),
|
|
@@ -626,7 +627,7 @@ App.config = Em.Object.create({
|
|
var connectedConfigs = configs.filter(function(config) {
|
|
var connectedConfigs = configs.filter(function(config) {
|
|
return !excludedConfigs.contains(App.config.configId(config.get('name'), config.get('filename'))) && (config.get('filename') === 'capacity-scheduler.xml');
|
|
return !excludedConfigs.contains(App.config.configId(config.get('name'), config.get('filename'))) && (config.get('filename') === 'capacity-scheduler.xml');
|
|
});
|
|
});
|
|
- connectedConfigs.setEach('isVisible', false);
|
|
|
|
|
|
+ var names = connectedConfigs.mapProperty('name');
|
|
|
|
|
|
connectedConfigs.forEach(function (config) {
|
|
connectedConfigs.forEach(function (config) {
|
|
value += config.get('name') + '=' + config.get('value') + '\n';
|
|
value += config.get('name') + '=' + config.get('value') + '\n';
|
|
@@ -652,10 +653,12 @@ App.config = Em.Object.create({
|
|
'recommendedIsFinal': recommendedIsFinal,
|
|
'recommendedIsFinal': recommendedIsFinal,
|
|
'displayName': 'Capacity Scheduler',
|
|
'displayName': 'Capacity Scheduler',
|
|
'description': 'Capacity Scheduler properties',
|
|
'description': 'Capacity Scheduler properties',
|
|
- 'displayType': 'capacityScheduler',
|
|
|
|
- 'isRequiredByAgent': false
|
|
|
|
|
|
+ 'displayType': 'capacityScheduler'
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+ configs = configs.filter(function(c) {
|
|
|
|
+ return !(names.contains(c.get('name')) && (c.get('filename') === 'capacity-scheduler.xml'));
|
|
|
|
+ });
|
|
configs.push(App.ServiceConfigProperty.create(cs));
|
|
configs.push(App.ServiceConfigProperty.create(cs));
|
|
return configs;
|
|
return configs;
|
|
},
|
|
},
|
|
@@ -679,6 +682,42 @@ App.config = Em.Object.create({
|
|
return properties;
|
|
return properties;
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * transform one config with textarea content
|
|
|
|
+ * into set of configs of file
|
|
|
|
+ * @param configs
|
|
|
|
+ * @param filename
|
|
|
|
+ * @return {*}
|
|
|
|
+ */
|
|
|
|
+ textareaIntoFileConfigs: function (configs, filename) {
|
|
|
|
+ var configsTextarea = configs.findProperty('name', 'capacity-scheduler');
|
|
|
|
+ if (configsTextarea && !App.get('testMode')) {
|
|
|
|
+ var properties = configsTextarea.get('value').split('\n');
|
|
|
|
+
|
|
|
|
+ properties.forEach(function (_property) {
|
|
|
|
+ var name, value;
|
|
|
|
+ if (_property) {
|
|
|
|
+ _property = _property.split('=');
|
|
|
|
+ name = _property[0];
|
|
|
|
+ value = (_property[1]) ? _property[1] : "";
|
|
|
|
+ configs.push(Em.Object.create({
|
|
|
|
+ name: name,
|
|
|
|
+ value: value,
|
|
|
|
+ savedValue: value,
|
|
|
|
+ serviceName: configsTextarea.get('serviceName'),
|
|
|
|
+ filename: filename,
|
|
|
|
+ isFinal: configsTextarea.get('isFinal'),
|
|
|
|
+ isNotDefaultValue: configsTextarea.get('isNotDefaultValue'),
|
|
|
|
+ isRequiredByAgent: configsTextarea.get('isRequiredByAgent'),
|
|
|
|
+ group: null
|
|
|
|
+ }));
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return configs.without(configsTextarea);
|
|
|
|
+ }
|
|
|
|
+ return configs;
|
|
|
|
+ },
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* trim trailing spaces for all properties.
|
|
* trim trailing spaces for all properties.
|
|
* trim both trailing and leading spaces for host displayType and hive/oozie datebases url.
|
|
* trim both trailing and leading spaces for host displayType and hive/oozie datebases url.
|