summaryrefslogtreecommitdiff
path: root/bin/sql_db.py
diff options
context:
space:
mode:
authorStephane Wirtel <stephane@tinyerp.com>2009-01-29 01:23:10 +0100
committerStephane Wirtel <stephane@tinyerp.com>2009-01-29 01:23:10 +0100
commite76c45479421e618519bf7f178b263c3bae3d9d5 (patch)
treeae2aaa0298442fc9037c981450843571289a1099 /bin/sql_db.py
parent2fdc099da6e27874e6e844a8f5cb0cc1fb639869 (diff)
[FIX] Don't use the hostname if it is in ('127.0.0.1', 'localhost')
lp bug: https://launchpad.net/bugs/319190 fixed bzr revid: stephane@tinyerp.com-20090129002310-75wuum4qpx5s8ac4
Diffstat (limited to 'bin/sql_db.py')
-rw-r--r--bin/sql_db.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/sql_db.py b/bin/sql_db.py
index b0212ac1ea4..acc4bb39ec5 100644
--- a/bin/sql_db.py
+++ b/bin/sql_db.py
@@ -204,6 +204,8 @@ class PoolManager(object):
cls._dsn = ''
for p in ('host', 'port', 'user', 'password'):
cfg = tools.config['db_' + p]
+ if p == 'host' and cfg in ('127.0.0.1', 'localhost'):
+ continue
if cfg:
cls._dsn += '%s=%s ' % (p, cfg)
return '%s dbname=%s' % (cls._dsn, db_name)