瀏覽代碼

HUE-9399 [fs] Run the config check for ABFS as the logged in user

Johan Ahlen 5 年之前
父節點
當前提交
8eae082a7e
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      apps/hive/src/hive/conf.py

+ 6 - 0
apps/hive/src/hive/conf.py

@@ -73,6 +73,7 @@ def config_validator(user):
   try:
     from desktop.lib.fsmanager import get_filesystem
     from aws.conf import is_enabled as is_s3_enabled
+    from azure.conf import is_abfs_enabled
     warehouse = beeswax.hive_site.get_metastore_warehouse_dir()
     fs = get_filesystem()
     fs_scheme = fs._get_scheme(warehouse)
@@ -82,6 +83,11 @@ def config_validator(user):
           fs.do_as_user(user, fs.stats, warehouse)
         else:
           LOG.warn("Warehouse is in S3, but no credential available.")
+      elif fs_scheme == 'abfs':
+        if is_abfs_enabled():
+          fs.do_as_user(user, fs.stats, warehouse)
+        else:
+          LOG.warn("Warehouse is in ABFS, but no credential available.")
       else:
         fs.do_as_superuser(fs.stats, warehouse)
   except Exception: