incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yus...@apache.org
Subject git commit: AMBARI-2808. Can't add from UI some queues in capacity-scheduler.xml. (Dmytro Shkvyra via yusaku)
Date Tue, 06 Aug 2013 21:03:44 GMT
Updated Branches:
  refs/heads/trunk 13ca404d3 -> 746d98f72


AMBARI-2808. Can't add from UI some queues in capacity-scheduler.xml. (Dmytro Shkvyra via
yusaku)


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

Branch: refs/heads/trunk
Commit: 746d98f72226537df0cb60290f5aeb44f70d4b08
Parents: 13ca404
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Tue Aug 6 14:03:34 2013 -0700
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Tue Aug 6 14:03:34 2013 -0700

----------------------------------------------------------------------
 ambari-web/app/utils/config.js       |  2 +-
 ambari-web/test/utils/config_test.js | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/746d98f7/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index ba14865..4186e59 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -827,7 +827,7 @@ 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, ',').split(',');
+    var properties = configsTextarea.get('value').replace(/( |\n)+/g, '\n').split('\n');
 
     properties.forEach(function(_property){
       var name, value;

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/746d98f7/ambari-web/test/utils/config_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/config_test.js b/ambari-web/test/utils/config_test.js
index f4667ff..2160347 100644
--- a/ambari-web/test/utils/config_test.js
+++ b/ambari-web/test/utils/config_test.js
@@ -192,7 +192,7 @@ describe('App.config', function () {
       {
         configs: [Em.Object.create({
           "name": "capacity-scheduler",
-          "value": "config1=value1,config2=value2\n",
+          "value": "config1=value1,value2\n",
           "filename": "capacity-scheduler.xml"
         })]
       },
@@ -219,13 +219,11 @@ describe('App.config', function () {
       expect(result[1].value).to.equal('value2');
       expect(result[1].name).to.equal('config2');
     });
-    it('config1=value1,config2=value2 to two configs', function () {
+    it('config1=value1,value2\n to one config', function () {
       var result = App.config.textareaIntoFileConfigs.call(App.config, testData[2].configs,
filename);
-      expect(result.length).to.equal(2);
-      expect(result[0].value).to.equal('value1');
+      expect(result.length).to.equal(1);
+      expect(result[0].value).to.equal('value1,value2');
       expect(result[0].name).to.equal('config1');
-      expect(result[1].value).to.equal('value2');
-      expect(result[1].name).to.equal('config2');
     });
     it('config1=value1 config2=value2 to two configs', function () {
       var result = App.config.textareaIntoFileConfigs.call(App.config, testData[3].configs,
filename);


Mime
View raw message