aboutsummaryrefslogtreecommitdiff
path: root/steuermann
diff options
context:
space:
mode:
Diffstat (limited to 'steuermann')
-rw-r--r--steuermann/config.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/steuermann/config.py b/steuermann/config.py
index 456fab2..1c926ea 100644
--- a/steuermann/config.py
+++ b/steuermann/config.py
@@ -2,13 +2,13 @@ from __future__ import print_function
import os
import sys
-_sys = sys.path
+_path = sys.path.copy()
config_dir = os.path.join(os.path.expanduser('~'), '.steuermann', 'default')
user_config = os.path.join(config_dir, 'config.py')
hosts_config = os.path.join(config_dir, 'hosts.ini')
-if not os.path.exists(config_dir):
- os.makedirs(config_dir, mode=0o700)
+#if not os.path.exists(config_dir):
+# os.makedirs(config_dir, mode=0o700)
try:
sys.path.insert(1, config_dir)
@@ -16,12 +16,16 @@ try:
except ImportError:
# We don't care if this config does exist, we have further options to test
try:
- user_config = os.path.abspath(os.environ['STEUERMANN_CONFIG'])
- sys.path = _sys
+ config_dir = os.path.abspath(os.environ['STEUERMANN_CONFIG'])
+ user_config = os.path.join(config_dir, 'config.py')
+ hosts_config = os.path.join(config_dir, 'hosts.ini')
+
+ sys.path = _path
sys.path.insert(1, config_dir)
try:
import config
- except ImportError:
+ except ImportError as e:
+ print(e)
print('FATAL: Missing config (i.e. {0})'.format(user_config))
exit(1)
except KeyError: