From c1fcf414d51d8388442f1282fdb8b9d051b332e6 Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Wed, 27 Jun 2018 03:20:02 -0700 Subject: [PATCH] Handle config.yaml file missing --- tljh/configurer.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tljh/configurer.py b/tljh/configurer.py index b3d5567..ba88a63 100644 --- a/tljh/configurer.py +++ b/tljh/configurer.py @@ -31,12 +31,12 @@ default = { def apply_yaml_config(path, c): - if not os.path.exists(path): + if os.path.exists(path): + with open(path) as f: + tljh_config = _merge_dictionaries(yaml.safe_load(f), default) + else: tljh_config = copy.deepcopy(default) - with open(path) as f: - tljh_config = _merge_dictionaries(yaml.safe_load(f), default) - update_auth(c, tljh_config) update_userlists(c, tljh_config) update_limits(c, tljh_config)