[FIX] runbot: use an uri as log-db only if runbot database is on another server

This commit is contained in:
Christophe Simonis 2015-02-11 14:21:51 +01:00
parent 2486921a60
commit 4e55f4f2f2

View File

@ -697,7 +697,7 @@ class runbot_build(osv.osv):
cmd.append("--no-netrpc")
if grep(build.server("tools/config.py"), "log-db"):
logdb = cr.dbname
if grep(build.server('sql_db.py'), 'allow_uri'):
if config['db_host'] and grep(build.server('sql_db.py'), 'allow_uri'):
logdb = 'postgres://{cfg[db_user]}:{cfg[db_password]}@{cfg[db_host]}/{db}'.format(cfg=config, db=cr.dbname)
cmd += ["--log-db=%s" % logdb]