ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ababiic...@apache.org
Subject ambari git commit: AMBARI-14857 Ambari UI does not accept dfs.data.dir entries with file protocol when enabling 'storage type' feature. (ababiichuk)
Date Mon, 01 Feb 2016 09:32:37 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 1e6a0c1d0 -> a97eaa6bf


AMBARI-14857 Ambari UI does not accept dfs.data.dir entries with file protocol when enabling
'storage type' feature. (ababiichuk)


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

Branch: refs/heads/branch-2.2
Commit: a97eaa6bf059d5683821830486a568123486c431
Parents: 1e6a0c1
Author: ababiichuk <ababiichuk@hortonworks.com>
Authored: Mon Feb 1 11:02:54 2016 +0200
Committer: ababiichuk <ababiichuk@hortonworks.com>
Committed: Mon Feb 1 11:32:12 2016 +0200

----------------------------------------------------------------------
 ambari-web/app/utils/validator.js       | 2 +-
 ambari-web/test/utils/validator_test.js | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/a97eaa6b/ambari-web/app/utils/validator.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/validator.js b/ambari-web/app/utils/validator.js
index 63c3aa6..58f74e6 100644
--- a/ambari-web/app/utils/validator.js
+++ b/ambari-web/app/utils/validator.js
@@ -76,7 +76,7 @@ module.exports = {
    * @returns {boolean}
    */
   isValidDataNodeDir: function(value) {
-    var dirRegex = /^(\[[0-9a-zA-Z]+\])?(\/[0-9a-z]*)/;
+    var dirRegex = /^(\[[0-9a-zA-Z]+\])?(file:\/\/)?(\/[0-9a-z]*)/;
     var winRegex = /^(\[[0-9a-zA-Z]+\])?[a-zA-Z]:\\[0-9a-zA-Z]*/;
     var winUrlRegex = /^(\[[0-9a-zA-Z]+\])?file:\/\/\/[a-zA-Z]:\/[0-9a-zA-Z]*/;
     var dirs = value.split(',');

http://git-wip-us.apache.org/repos/asf/ambari/blob/a97eaa6b/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 021bd47..bee2309 100644
--- a/ambari-web/test/utils/validator_test.js
+++ b/ambari-web/test/utils/validator_test.js
@@ -326,6 +326,7 @@ describe('validator', function () {
       {m:'"/1a2b3c" - valid',i:'/1a2b3c',e:true},
       {m:'"[ssd]/1a2b3c" - valid',i:'[ssd]/1a2b3c',e:true},
       {m:'"[DISK]/1a2b3c" - valid',i:'[DISK]/1a2b3c',e:true},
+      {m:'"[DISK]file:///1a2b3c" - valid',i:'[DISK]file:///1a2b3c',e:true},
       {m:'"[] /1a2b3c" - invalid',i:'[] /1a2b3c',e:false},
       {m:'"[ssd] /1a2b3c" - invalid',i:'[ssd] /1a2b3c',e:false},
       {m:'"[/1a2b3c]" - invalid',i:'[/1a2b3c]',e:false},


Mime
View raw message