Explorar o código

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 %!s(int64=11) %!d(string=hai) anos
pai
achega
94d77172f1
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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):