This is an automated email from the ASF dual-hosted git repository.

rmani pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ranger.git


The following commit(s) were added to refs/heads/master by this push:
     new e3ff179  RANGER-2874:Tag policies not getting enforced for ADLS path
e3ff179 is described below

commit e3ff179223f87b8fe3c66b08d6c48eda3f0e6f7b
Author: Ramesh Mani <ramesh.m...@gmail.com>
AuthorDate: Fri Jun 26 08:05:23 2020 -0700

    RANGER-2874:Tag policies not getting enforced for ADLS path
    
    Signed-off-by: Ramesh Mani <ramesh.m...@gmail.com>
---
 .../apache/ranger/tagsync/source/atlas/AtlasAdlsResourceMapper.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasAdlsResourceMapper.java
 
b/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasAdlsResourceMapper.java
index 120b925..975c9f1 100644
--- 
a/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasAdlsResourceMapper.java
+++ 
b/tagsync/src/main/java/org/apache/ranger/tagsync/source/atlas/AtlasAdlsResourceMapper.java
@@ -101,6 +101,10 @@ public class AtlasAdlsResourceMapper extends 
AtlasResourceMapper {
                                throwExceptionWithMessage("relative-path not 
found in attribute '" +  ENTITY_ATTRIBUTE_QUALIFIED_NAME + "': " + 
qualifiedName);
                        }
 
+                       if (relativePath.endsWith("/") && relativePath.length() 
!= 1) {
+                               relativePath = relativePath.substring(0, 
relativePath.lastIndexOf("/"));
+                       }
+
                        elements.put(RANGER_TYPE_ADLS_GEN2_ACCOUNT, new 
RangerPolicyResource(accountName));
                        elements.put(RANGER_TYPE_ADLS_GEN2_CONTAINER, new 
RangerPolicyResource(containerName));
                        elements.put(RANGER_TYPE_ADLS_GEN2_RELATIVE_PATH, new 
RangerPolicyResource(relativePath, Boolean.FALSE, Boolean.TRUE));

Reply via email to