This is an automated email from the ASF dual-hosted git repository.
maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git
The following commit(s) were added to refs/heads/master by this push:
new ef06a9d Create DATA_DIR after importing config (#4143)
ef06a9d is described below
commit ef06a9d497b4225727b4a37bfeeccc0152c12fa0
Author: Leonardo Rochael Almeida <[email protected]>
AuthorDate: Wed Jan 3 15:54:59 2018 -0200
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.
---
superset/__init__.py | 3 +++
superset/config.py | 2 --
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/superset/__init__.py b/superset/__init__.py
index 9ef665e..5d0c674 100644
--- a/superset/__init__.py
+++ b/superset/__init__.py
@@ -22,6 +22,9 @@ from superset import utils, config # noqa
APP_DIR = os.path.dirname(__file__)
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:
frontend_config = json.load(f)
diff --git a/superset/config.py b/superset/config.py
index e169f12..c2da1db 100644
--- a/superset/config.py
+++ b/superset/config.py
@@ -28,8 +28,6 @@ if 'SUPERSET_HOME' in os.environ:
DATA_DIR = os.environ['SUPERSET_HOME']
else:
DATA_DIR = os.path.join(os.path.expanduser('~'), '.superset')
-if not os.path.exists(DATA_DIR):
- os.makedirs(DATA_DIR)
# ---------------------------------------------------------
# Superset specific config
--
To stop receiving notification emails like this one, please contact
['"[email protected]" <[email protected]>'].