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-3009. Trim and/or validate config parameter values to prevent failures due to extra spaces. (Andrii Babiichuk via yusaku)
Date Tue, 17 Sep 2013 17:20:05 GMT
Updated Branches:
  refs/heads/trunk 048ce9271 -> 3633b1e0a


AMBARI-3009. Trim and/or validate config parameter values to prevent failures due to extra
spaces. (Andrii Babiichuk 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/3633b1e0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/3633b1e0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/3633b1e0

Branch: refs/heads/trunk
Commit: 3633b1e0a3c0978955c64c2ce5c8fb0c810f1e46
Parents: 048ce92
Author: Yusaku Sako <yusaku@hortonworks.com>
Authored: Tue Sep 17 10:19:03 2013 -0700
Committer: Yusaku Sako <yusaku@hortonworks.com>
Committed: Tue Sep 17 10:19:56 2013 -0700

----------------------------------------------------------------------
 ambari-web/app/controllers/main/service/info/configs.js | 1 +
 ambari-web/app/controllers/wizard/step8_controller.js   | 4 ++--
 ambari-web/app/utils/config.js                          | 7 +++----
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/3633b1e0/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 0ec4731..50ce72c 100644
--- a/ambari-web/app/controllers/main/service/info/configs.js
+++ b/ambari-web/app/controllers/main/service/info/configs.js
@@ -1004,6 +1004,7 @@ App.MainServiceInfoConfigsController = Em.Controller.extend({
     var serviceConfigProperties = configs.filterProperty('id', 'site property');
     serviceConfigProperties.forEach(function(_config){
       if(typeof _config.get('value') === "boolean") _config.set('value', _config.value.toString());
+      _config.set('value', App.config.trimProperty(_config),true);
     });
     var storedConfigs = serviceConfigProperties.filterProperty('value');
     var allUiConfigs = this.loadUiSideConfigs(this.get('configMapping').all());

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/3633b1e0/ambari-web/app/controllers/wizard/step8_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js
index ff916bc..2850375 100644
--- a/ambari-web/app/controllers/wizard/step8_controller.js
+++ b/ambari-web/app/controllers/wizard/step8_controller.js
@@ -78,7 +78,7 @@ App.WizardStep8Controller = Em.Controller.extend({
       this.set('securityEnabled', App.router.get('mainAdminSecurityController').getUpdatedSecurityStatus());
     }
     this.clearStep();
-    this.formatDirectories();
+    this.formatProperties();
     this.loadGlobals();
     this.loadConfigs();
     this.loadClusterInfo();
@@ -89,7 +89,7 @@ App.WizardStep8Controller = Em.Controller.extend({
   /**
    * replace whitespace character with coma between directories
    */
-  formatDirectories: function(){
+  formatProperties: function(){
     this.get('content.serviceConfigProperties').forEach(function(_configProperty){
         _configProperty.value = App.config.trimProperty(_configProperty,false);
     });

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/3633b1e0/ambari-web/app/utils/config.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/config.js b/ambari-web/app/utils/config.js
index 17fbbd9..8a577a2 100644
--- a/ambari-web/app/utils/config.js
+++ b/ambari-web/app/utils/config.js
@@ -979,15 +979,14 @@ App.config = Em.Object.create({
       case 'host':
         rez = value.trim();
         break;
+      case 'password':
+        break;
       case 'advanced':
         if(name == 'hive_jdbc_connection_url' || name == 'oozie_jdbc_connection_url') {
           rez = value.trim();
         }
-        break;
-      case 'password':
-        break;
       default:
-        rez = (value instanceof String) ? value.replace(/(\s+$)/g, '') : value;
+        rez = (typeof value == 'string') ? value.replace(/(\s+$)/g, '') : value;
     }
     return ((rez == '') || (rez == undefined)) ? value : rez;
   }


Mime
View raw message