[FIX] sql_db: use the config values later than at import time.

lp bug: https://launchpad.net/bugs/716715 fixed

bzr revid: vmt@openerp.com-20110308140449-5v883yms1z8dy23k
This commit is contained in:
Vo Minh Thu 2011-03-08 15:04:49 +01:00
parent acef7835aa
commit 8fae3e7c6f
1 changed files with 6 additions and 7 deletions

View File

@ -358,14 +358,13 @@ class Connection(object):
except Exception:
return False
_dsn = ''
for p in ('host', 'port', 'user', 'password'):
cfg = tools.config['db_' + p]
if cfg:
_dsn += '%s=%s ' % (p, cfg)
def dsn(db_name):
_dsn = ''
for p in ('host', 'port', 'user', 'password'):
cfg = tools.config['db_' + p]
if cfg:
_dsn += '%s=%s ' % (p, cfg)
return '%sdbname=%s' % (_dsn, db_name)
def dsn_are_equals(first, second):