Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

[FIX] runbot_travis2docker: Fix server options #107

Merged
merged 1 commit into from
Nov 15, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions runbot_travis2docker/models/runbot_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@ def job_20_test_all(self, cr, uid, build, lock_path, log_path):
] + pr_cmd_env
logdb = cr.dbname
if config['db_host'] and not travis_branch.startswith('7.0'):
logdb = 'postgres://{cfg[db_user]}:{cfg[db_password]}@' +\
'{cfg[db_host]}/{db}'.format(cfg=config, db=cr.dbname)
logdb = 'postgres://%s:%s@%s/%s' % (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about use:

('postgres://{cfg[db_user]}:{cfg[db_password]}@'
 '{cfg[db_host]}/{db}').format(cfg=config, db=cr.dbname)

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the string not spanning multiple lines looks better, but I have no explicit preference. I was also adhering to the OCA convention to use % over .format

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right!

config['db_user'], config['db_password'],
config['db_host'], cr.dbname,
)
cmd += ['-e', 'SERVER_OPTIONS="--log-db=%s"' % logdb]
return self.spawn(cmd, lock_path, log_path)

Expand Down