瀏覽代碼

HUE-6514 [optimizer] Correctly load password from script when specified

Romain Rigaux 8 年之前
父節點
當前提交
549f1b8
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      desktop/libs/metadata/src/metadata/conf.py

+ 5 - 1
desktop/libs/metadata/src/metadata/conf.py

@@ -67,6 +67,10 @@ def get_security_default():
 
   return cluster.SECURITY_ENABLED.get()
 
+def get_optimizer_password_script():
+  '''Get default password from secured file'''
+  return OPTIMIZER.AUTH_KEY_SECRET_SCRIPT.get()
+
 
 OPTIMIZER = ConfigSection(
   key='optimizer',
@@ -86,7 +90,7 @@ OPTIMIZER = ConfigSection(
       key="auth_key_secret",
       help=_t("The private part of the key associated with the auth_key."),
       private=True,
-      default=None),
+      dynamic_default=get_optimizer_password_script),
     AUTH_KEY_SECRET_SCRIPT=Config(
       key="auth_key_secret_script",
       help=_t("Execute this script to produce the auth_key secret. This will be used when `auth_key_secret` is not set."),