ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rkam...@apache.org
Subject [3/3] ambari git commit: AMBARI-19335 To support permission in string format for FS action node (Venkata Sairam via r-kamath)
Date Wed, 04 Jan 2017 07:25:01 GMT
AMBARI-19335 To support permission in string format for FS  action node (Venkata Sairam via
r-kamath)


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

Branch: refs/heads/trunk
Commit: 34bc40ece5b0dc6eed311ecccf7a29f822db1879
Parents: 976e40a
Author: Renjith Kamath <renjith.kamath@gmail.com>
Authored: Wed Jan 4 12:52:08 2017 +0530
Committer: Renjith Kamath <renjith.kamath@gmail.com>
Committed: Wed Jan 4 12:53:42 2017 +0530

----------------------------------------------------------------------
 .../resources/ui/app/domain/actionjob_hanlder.js   | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/34bc40ec/contrib/views/wfmanager/src/main/resources/ui/app/domain/actionjob_hanlder.js
----------------------------------------------------------------------
diff --git a/contrib/views/wfmanager/src/main/resources/ui/app/domain/actionjob_hanlder.js
b/contrib/views/wfmanager/src/main/resources/ui/app/domain/actionjob_hanlder.js
index af61c91..b0453e2 100644
--- a/contrib/views/wfmanager/src/main/resources/ui/app/domain/actionjob_hanlder.js
+++ b/contrib/views/wfmanager/src/main/resources/ui/app/domain/actionjob_hanlder.js
@@ -434,8 +434,19 @@ var FSActionJobHandler=ActionJobHandler.extend({
             settings.path=fileOpJson._path;
             settings.permissions=fileOpJson._permissions;
             var perm = settings.permissions.toString();
-
-
+            if(isNaN(perm)){
+              var permList = {"-":0,"r":1,"w":2,"x":4}, permissionNumFormat = "", permTokenNum
= 0, tempArr = [1,4,7];
+              for(let p=0; p<tempArr.length; p++){
+                  var permToken = perm.slice(tempArr[p],tempArr[p]+3);
+                  for(let q=0; q<permToken.length; q++){
+                    var tok = permList[permToken.slice(q,q+1)]
+                    permTokenNum = permTokenNum + tok;
+                  }
+                  permissionNumFormat = permissionNumFormat +""+ permTokenNum;
+                  permTokenNum = 0;
+              }
+              perm = permissionNumFormat;
+            }
             for(var i=0; i< perm.length; i++){
               var keyField;
               if(i===0){
@@ -477,7 +488,7 @@ var FSActionJobHandler=ActionJobHandler.extend({
                 settings[keyField+"read"] = 1;
                 settings[keyField+"write"] = 2;
                 settings[keyField+"execute"] = 4;
-              }              
+              }
             }
             settings.dirfiles=fileOpJson["_dir-files"];
             if(fileOpJson.hasOwnProperty("recursive")){


Mime
View raw message