Browse Source

HUE-2467 [sentry] Check NN plugin prefixes for exact match of subpath

Do not match /user/hive/warehouse3 if prefix is /user/hive/warehouse
Romain Rigaux 11 năm trước cách đây
mục cha
commit
94d77172f1
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      desktop/libs/hadoop/src/hadoop/fs/webhdfs.py

+ 1 - 1
desktop/libs/hadoop/src/hadoop/fs/webhdfs.py

@@ -110,7 +110,7 @@ class WebHdfs(Hdfs):
   def is_sentry_managed(cls, path):
     prefixes = get_nn_sentry_prefixes().split(',')
 
-    return any([path.startswith(p) for p in prefixes if p])
+    return any([path == p or path.startswith(p + '/') for p in prefixes if p])
 
   @property
   def fs_defaultfs(self):