From: Jonatan Schlag Date: Tue, 10 Oct 2017 13:55:23 +0000 (+0200) Subject: Load configurations only if the config file exists X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a2db7eeacea0d1ab647ae629d08522cb743dc722;p=people%2Fjschlag%2Fpbs.git Load configurations only if the config file exists Signed-off-by: Jonatan Schlag --- diff --git a/src/buildservice/__init__.py b/src/buildservice/__init__.py index be81ba0..9619bfe 100644 --- a/src/buildservice/__init__.py +++ b/src/buildservice/__init__.py @@ -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