Return-Path: X-Original-To: apmail-ambari-commits-archive@www.apache.org Delivered-To: apmail-ambari-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2512517677 for ; Wed, 29 Oct 2014 12:33:20 +0000 (UTC) Received: (qmail 76241 invoked by uid 500); 29 Oct 2014 12:33:20 -0000 Delivered-To: apmail-ambari-commits-archive@ambari.apache.org Received: (qmail 76213 invoked by uid 500); 29 Oct 2014 12:33:20 -0000 Mailing-List: contact commits-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: ambari-dev@ambari.apache.org Delivered-To: mailing list commits@ambari.apache.org Received: (qmail 76204 invoked by uid 99); 29 Oct 2014 12:33:20 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Oct 2014 12:33:20 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 947FDA0071B; Wed, 29 Oct 2014 12:33:19 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ababiichuk@apache.org To: commits@ambari.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: git commit: AMBARI-8003 UI changes for Ambari Datanode directories need to allow for heterogeneous storage tags 2. (ababiichuk) Date: Wed, 29 Oct 2014 12:33:19 +0000 (UTC) Repository: ambari Updated Branches: refs/heads/branch-1.7.0 f2e55395e -> 09c42383a AMBARI-8003 UI changes for Ambari Datanode directories need to allow for heterogeneous storage tags 2. (ababiichuk) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/09c42383 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/09c42383 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/09c42383 Branch: refs/heads/branch-1.7.0 Commit: 09c42383a01dd81dd2a98d42ad799336cbed886f Parents: f2e5539 Author: aBabiichuk Authored: Wed Oct 29 14:09:24 2014 +0200 Committer: aBabiichuk Committed: Wed Oct 29 14:09:24 2014 +0200 ---------------------------------------------------------------------- ambari-web/app/models/service_config.js | 2 +- ambari-web/app/utils/validator.js | 2 +- ambari-web/test/utils/validator_test.js | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/09c42383/ambari-web/app/models/service_config.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/models/service_config.js b/ambari-web/app/models/service_config.js index 720b625..b836247 100644 --- a/ambari-web/app/models/service_config.js +++ b/ambari-web/app/models/service_config.js @@ -811,7 +811,7 @@ App.ServiceConfigProperty = Ember.Object.extend({ break; case 'datanodedirs': if (!validator.isValidDataNodeDir(value)) { - this.set('errorMessage', 'dir format is wrong, can be "[{storage type}] /{dir name}"'); + this.set('errorMessage', 'dir format is wrong, can be "[{storage type}]/{dir name}"'); isError = true; } else { http://git-wip-us.apache.org/repos/asf/ambari/blob/09c42383/ambari-web/app/utils/validator.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/utils/validator.js b/ambari-web/app/utils/validator.js index 70ca3f7..81c3dd6 100644 --- a/ambari-web/app/utils/validator.js +++ b/ambari-web/app/utils/validator.js @@ -62,7 +62,7 @@ module.exports = { * @returns {boolean} */ isValidDataNodeDir: function(value) { - var floatRegex = /(^\[[0-9a-z]+\]$)|(^\/[0-9a-z]*)/; + var floatRegex = /^(\[[0-9a-z]+\])?(\/[0-9a-z]*)/; var dirs = value.replace(/,/g,' ').trim().split(new RegExp("\\s+", "g")); for(var i = 0; i < dirs.length; i++){ if(!floatRegex.test(dirs[i])){ http://git-wip-us.apache.org/repos/asf/ambari/blob/09c42383/ambari-web/test/utils/validator_test.js ---------------------------------------------------------------------- diff --git a/ambari-web/test/utils/validator_test.js b/ambari-web/test/utils/validator_test.js index 5458b9e..ba5d6bc 100644 --- a/ambari-web/test/utils/validator_test.js +++ b/ambari-web/test/utils/validator_test.js @@ -296,7 +296,7 @@ describe('validator', function () { }) }); }); - describe.only('#isValidDataNodeDir(value)', function() { + describe('#isValidDataNodeDir(value)', function() { var tests = [ {m:'"dir" - invalid',i:'dir',e:false}, {m:'"/dir" - valid',i:'/dir',e:true}, @@ -305,9 +305,9 @@ describe('validator', function () { {m:'"/123" - valid',i:'/111',e:true}, {m:'"/abc" - valid',i:'/abc',e:true}, {m:'"/1a2b3c" - valid',i:'/1a2b3c',e:true}, - {m:'"[ssd] /1a2b3c" - valid',i:'[ssd] /1a2b3c',e:true}, + {m:'"[ssd]/1a2b3c" - valid',i:'[ssd]/1a2b3c',e:true}, {m:'"[] /1a2b3c" - invalid',i:'[] /1a2b3c',e:false}, - {m:'"[ssd]/1a2b3c" - invalid',i:'[ssd]/1a2b3c',e:false}, + {m:'"[ssd] /1a2b3c" - invalid',i:'[ssd] /1a2b3c',e:false}, {m:'"[/1a2b3c]" - invalid',i:'[/1a2b3c]',e:false}, {m:'"[s]ss /sd" - invalid',i:'[s]ss /sd',e:false}