diff --git a/trytond/config.py b/trytond/config.py index e850a20186..154f8be1fb 100644 --- a/trytond/config.py +++ b/trytond/config.py @@ -102,14 +102,14 @@ class ConfigManager(object): self.options['db_name'] = db_name init = {} - if opt.init and self.options.get('db_name'): + if opt.init: for i in opt.init.split(','): if i != 'tests': init[i] = 1 self.options['init'] = init update = {} - if opt.update and self.options.get('db_name'): + if opt.update: for i in opt.update.split(','): if i != 'tests': update[i] = 1 diff --git a/trytond/server.py b/trytond/server.py index 5ec33d9f70..8a657110a8 100644 --- a/trytond/server.py +++ b/trytond/server.py @@ -70,6 +70,11 @@ class TrytonServer(object): update = False init = {} + + if not CONFIG["db_name"] \ + and bool(CONFIG['init'] or CONFIG['update']): + raise Exception('Missing database option!') + for db_name in CONFIG["db_name"]: init[db_name] = False database = Database(db_name).connect()