]> git.ipfire.org Git - people/jschlag/pbs.git/commitdiff
Load configurations only if the config file exists
authorJonatan Schlag <jonatan.schlag@ipfire.org>
Tue, 10 Oct 2017 13:39:04 +0000 (15:39 +0200)
committerJonatan Schlag <jonatan.schlag@ipfire.org>
Tue, 10 Oct 2017 13:39:04 +0000 (15:39 +0200)
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
src/buildservice/__init__.py

index be81ba025cc89242ad325b232895b210afe56466..9619bfecfe58b4e0a14ce93d6986fd01281e90ce 100644 (file)
@@ -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