mirror of
https://github.com/apache/superset.git
synced 2024-09-17 11:09:47 -04:00
Create DATA_DIR after importing config (#4143)
Delay creating DATA_DIR until config is fully imported. This allows superset_config.py to override DATA_DIR before superset attempts to create it in a potentially unwriteable location.
This commit is contained in:
parent
37205099db
commit
ef06a9d497
@ -22,6 +22,9 @@ from superset import utils, config # noqa
|
|||||||
APP_DIR = os.path.dirname(__file__)
|
APP_DIR = os.path.dirname(__file__)
|
||||||
CONFIG_MODULE = os.environ.get('SUPERSET_CONFIG', 'superset.config')
|
CONFIG_MODULE = os.environ.get('SUPERSET_CONFIG', 'superset.config')
|
||||||
|
|
||||||
|
if not os.path.exists(config.DATA_DIR):
|
||||||
|
os.makedirs(config.DATA_DIR)
|
||||||
|
|
||||||
with open(APP_DIR + '/static/assets/backendSync.json', 'r') as f:
|
with open(APP_DIR + '/static/assets/backendSync.json', 'r') as f:
|
||||||
frontend_config = json.load(f)
|
frontend_config = json.load(f)
|
||||||
|
|
||||||
|
@ -28,8 +28,6 @@ if 'SUPERSET_HOME' in os.environ:
|
|||||||
DATA_DIR = os.environ['SUPERSET_HOME']
|
DATA_DIR = os.environ['SUPERSET_HOME']
|
||||||
else:
|
else:
|
||||||
DATA_DIR = os.path.join(os.path.expanduser('~'), '.superset')
|
DATA_DIR = os.path.join(os.path.expanduser('~'), '.superset')
|
||||||
if not os.path.exists(DATA_DIR):
|
|
||||||
os.makedirs(DATA_DIR)
|
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Superset specific config
|
# Superset specific config
|
||||||
|
Loading…
Reference in New Issue
Block a user