Return-Path: X-Original-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-ambari-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C89C6109C8 for ; Tue, 17 Sep 2013 17:20:11 +0000 (UTC) Received: (qmail 95587 invoked by uid 500); 17 Sep 2013 17:20:11 -0000 Delivered-To: apmail-incubator-ambari-commits-archive@incubator.apache.org Received: (qmail 95563 invoked by uid 500); 17 Sep 2013 17:20:10 -0000 Mailing-List: contact ambari-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@incubator.apache.org Delivered-To: mailing list ambari-commits@incubator.apache.org Received: (qmail 95534 invoked by uid 99); 17 Sep 2013 17:20:06 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Sep 2013 17:20:06 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 449E8A207; Tue, 17 Sep 2013 17:20:05 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: yusaku@apache.org To: ambari-commits@incubator.apache.org Message-Id: <57694102cdb04a49b46943d1048ec160@git.apache.org> X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) 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 Authored: Tue Sep 17 10:19:03 2013 -0700 Committer: Yusaku Sako 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; }