[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:
parent
4921167d74
commit
33ce0e73db
|
@ -94,11 +94,11 @@ def preload_registry(dbname):
|
||||||
""" Preload a registry, and start the cron."""
|
""" Preload a registry, and start the cron."""
|
||||||
try:
|
try:
|
||||||
update_module = True if openerp.tools.config['init'] or openerp.tools.config['update'] else False
|
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:
|
except Exception:
|
||||||
_logger.exception('Failed to initialize database `%s`.', dbname)
|
_logger.exception('Failed to initialize database `%s`.', dbname)
|
||||||
return False
|
return False
|
||||||
return True
|
return registry._assertion_report.failures == 0
|
||||||
|
|
||||||
def run_test_file(dbname, test_file):
|
def run_test_file(dbname, test_file):
|
||||||
""" Preload a registry, possibly run a test file, and start the cron."""
|
""" Preload a registry, possibly run a test file, and start the cron."""
|
||||||
|
|
Loading…
Reference in New Issue