[1/3] Load configurations only if the config file exists
Commit Message
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
---
src/buildservice/__init__.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
@@ -84,8 +84,11 @@ class Backend(object):
# Load all configuration files
for path in paths:
- log.debug("Loading configuration from %s" % path)
- c.read(path)
+ if os.path.exists(path):
+ log.debug("Loading configuration from %s" % path)
+ c.read(path)
+ else:
+ log.error("No such file %s" % path)
return c