[FIX] When running with --stop-after-init, return code must be not null if any failure happen.

bzr revid: chs@openerp.com-20131118132235-84u5hfccm784ge5l
This commit is contained in:
Christophe Simonis 2013-11-18 14:22:35 +01:00
parent 4921167d74
commit 33ce0e73db
1 changed files with 2 additions and 2 deletions

View File

@ -94,11 +94,11 @@ def preload_registry(dbname):
""" Preload a registry, and start the cron."""
try:
update_module = True if openerp.tools.config['init'] or openerp.tools.config['update'] else False
openerp.modules.registry.RegistryManager.new(dbname, update_module=update_module)
registry = openerp.modules.registry.RegistryManager.new(dbname, update_module=update_module)
except Exception:
_logger.exception('Failed to initialize database `%s`.', dbname)
return False
return True
return registry._assertion_report.failures == 0
def run_test_file(dbname, test_file):
""" Preload a registry, possibly run a test file, and start the cron."""