Skip to content

Commit

Permalink
Fix importing config from env var (#2983)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmchen authored and mistercrunch committed Jun 20, 2017
1 parent 7e5e229 commit ba93e6a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion superset/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import imp
import json
import os
import sys
from collections import OrderedDict

from dateutil import tz
Expand Down Expand Up @@ -308,7 +309,12 @@ class CeleryConfig(object):
# 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
Expand Down

0 comments on commit ba93e6a

Please sign in to comment.