ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
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 GMT
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 <ababiichuk@cybervisiontech.com>
Authored: Wed Oct 29 14:09:24 2014 +0200
Committer: aBabiichuk <ababiichuk@cybervisiontech.com>
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}
 


Mime
View raw message