[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:
parent
acef7835aa
commit
8fae3e7c6f
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue