mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
Fix importing config from env var (#2983)
This commit is contained in:
parent
7e5e229f48
commit
ba93e6a2d1
@ -12,6 +12,7 @@ from __future__ import unicode_literals
|
||||
import imp
|
||||
import json
|
||||
import os
|
||||
import sys
|
||||
from collections import OrderedDict
|
||||
|
||||
from dateutil import tz
|
||||
@ -308,7 +309,12 @@ try:
|
||||
# for case where app is being executed via pex.
|
||||
print('Loaded your LOCAL configuration at [{}]'.format(
|
||||
os.environ[CONFIG_PATH_ENV_VAR]))
|
||||
imp.load_source('superset_config', os.environ[CONFIG_PATH_ENV_VAR])
|
||||
module = sys.modules[__name__]
|
||||
override_conf = imp.load_source('superset_config', os.environ[CONFIG_PATH_ENV_VAR])
|
||||
for key in dir(override_conf):
|
||||
if key.isupper():
|
||||
setattr(module, key, getattr(override_conf, key))
|
||||
|
||||
else:
|
||||
from superset_config import * # noqa
|
||||
import superset_config
|
||||
|
Loading…
Reference in New Issue
Block a user