]> git.ipfire.org Git - pakfire.git/commitdiff
config: Don't file if a file does not exist
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 20 May 2017 10:05:43 +0000 (12:05 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 20 May 2017 10:05:43 +0000 (12:05 +0200)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/pakfire/config.py

index cccac7b4e7474db621259d85d29a31f39658f278..8d3b20b94052998e94627c0f535b23a60e6b8e11 100644 (file)
@@ -48,6 +48,10 @@ class Config(object):
                if not path.startswith("/"):
                        path = os.path.join(CONFIG_DIR, path)
 
+               # Silently return if nothing is found
+               if not os.path.exists(path):
+                       return
+
                log.debug("Reading configuration from %s" % path)
 
                with open(path) as f: