Browse Source

AMBARI-2870 Add host wizard does not go past Assign Slaves and Clients. (atkach)

atkach 12 years ago
parent
commit
cd30718c6a
2 changed files with 23 additions and 19 deletions
  1. 1 1
      ambari-web/app/controllers/wizard/step7_controller.js
  2. 22 18
      ambari-web/app/utils/config.js

+ 1 - 1
ambari-web/app/controllers/wizard/step7_controller.js

@@ -85,7 +85,7 @@ App.WizardStep7Controller = Em.Controller.extend({
     //STEP 5: Add custom configs
     App.config.addCustomConfigs(configs);
     //put properties from capacity-scheduler.xml into one config with textarea view
-    if(this.get('selectedServiceNames').contains('YARN') && !App.supports.capacitySchedulerUi){
+    if(this.get('allInstalledServiceNames').contains('YARN') && !App.supports.capacitySchedulerUi){
       configs = App.config.fileConfigsIntoTextarea(configs, 'capacity-scheduler.xml');
     }
     //STEP 6: Distribute configs by service and wrap each one in App.ServiceConfigProperty (configs -> serviceConfigs)

+ 22 - 18
ambari-web/app/utils/config.js

@@ -828,25 +828,29 @@ App.config = Em.Object.create({
   textareaIntoFileConfigs: function(configs, filename){
     var complexConfigName = this.get('complexConfigs').findProperty('filename', filename).name;
     var configsTextarea = configs.findProperty('name', complexConfigName);
-    var properties = configsTextarea.get('value').replace(/( |\n)+/g, '\n').split('\n');
+    if (configsTextarea) {
+      var properties = configsTextarea.get('value').replace(/( |\n)+/g, '\n').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({
-          id: configsTextarea.get('id'),
-          name: name,
-          value: value,
-          defaultValue: value,
-          serviceName: configsTextarea.get('serviceName'),
-          filename: filename
-        }));
-      }
-    });
-    return configs.without(configsTextarea);
+      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({
+            id: configsTextarea.get('id'),
+            name: name,
+            value: value,
+            defaultValue: value,
+            serviceName: configsTextarea.get('serviceName'),
+            filename: filename
+          }));
+        }
+      });
+      return configs.without(configsTextarea);
+    }
+    console.log('ERROR: textarea config - ' + complexConfigName + ' is missing');
+    return configs;
   }
 
 });