Skip to content

Commit

Permalink
Update establish_ssh_tunnel
Browse files Browse the repository at this point in the history
  • Loading branch information
vshepard committed Jun 4, 2024
1 parent 013b359 commit 2afcc92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testgres/operations/remote_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def db_connect(self, dbname, user, password=None, host="localhost", port=5432):
self.establish_ssh_tunnel(local_port=local_port, remote_port=port)
try:
conn = pglib.connect(
host=host,
host='localhost',
port=local_port,
database=dbname,
user=user,
Expand All @@ -423,7 +423,7 @@ def db_connect(self, dbname, user, password=None, host="localhost", port=5432):
print("Database connection established successfully.")
return conn
except Exception as e:
print(f"Error connecting to the database: {str(e)}")
print(f"!!!Error connecting to the database: {str(e)}")
if self.tunnel_process:
self.tunnel_process.terminate()
print("SSH tunnel closed due to connection failure.")
Expand Down

0 comments on commit 2afcc92

Please sign in to comment.