Add support for the hostaddr connection parameter. This helps us play nicely with Kerberos/SSPI and friends. Fixes #2191

This commit is contained in:
Atul Sharma
2017-06-26 15:48:59 -04:00
committed by Dave Page
parent 3f4781cdcb
commit 15cb9fc35b
7 changed files with 149 additions and 7 deletions
@@ -316,6 +316,7 @@ class Connection(BaseConnection):
pg_conn = psycopg2.connect(
host=mgr.host,
hostaddr=mgr.hostaddr,
port=mgr.port,
database=database,
user=user,
@@ -1106,6 +1107,7 @@ Failed to execute query (execute_void) for the server #{server_id} - {conn_id}
try:
pg_conn = psycopg2.connect(
host=mgr.host,
hostaddr=mgr.hostaddr,
port=mgr.port,
database=self.db,
user=mgr.user,
@@ -1373,6 +1375,7 @@ Failed to reset the connection to the server due to following error:
try:
pg_conn = psycopg2.connect(
host=self.manager.host,
hostaddr=self.manager.hostaddr,
port=self.manager.port,
database=self.db,
user=self.manager.user,
@@ -1519,6 +1522,7 @@ class ServerManager(object):
self.sid = server.id
self.host = server.host
self.hostaddr = server.hostaddr
self.port = server.port
self.db = server.maintenance_db
self.did = None