aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/common.py b/common.py
index e1c13ab..247e733 100644
--- a/common.py
+++ b/common.py
@@ -48,10 +48,12 @@ def load_config(path=None, groupnames=None):
for p in [Path(),
Path(xdg_config_home).joinpath('webmap'),
PosixPath('/etc').joinpath('webmap')]:
- p = p.joinpath('config.yml')
- if p.exists():
- path = str(p)
+ p = str(p.joinpath('config.yml'))
+ if os.path.exists(p):
+ path = p
break
+ if path is None:
+ raise Exception('Could not find configuration file')
with open(path, 'r') as fp:
config = yaml.safe_load(fp)
layers = config.get('layers', {})