Bläddra i källkod

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

Johan Ahlen 5 år sedan
förälder
incheckning
8eae082a7e
1 ändrade filer med 6 tillägg och 0 borttagningar
  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: