Signed-off-by: Jonatan Schlag jonatan.schlag@ipfire.org --- src/buildservice/__init__.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/buildservice/__init__.py b/src/buildservice/__init__.py index 9619bfe..7a744f5 100644 --- a/src/buildservice/__init__.py +++ b/src/buildservice/__init__.py @@ -94,10 +94,13 @@ class Backend(object):
@lazy_property def db(self): - name = self.config.get("database", "name") - hostname = self.config.get("database", "hostname") - user = self.config.get("database", "user") - password = self.config.get("database", "password") + try: + name = self.config.get("database", "name") + hostname = self.config.get("database", "hostname") + user = self.config.get("database", "user") + password = self.config.get("database", "password") + except ConfigParser.Error as e: + log.error("Error parsing the config: %s" % e.message)
log.debug("Connecting to database %s @ %s" % (name, hostname))