From 2afcc929d347beb22e95dbcba1cde2a35416c33e Mon Sep 17 00:00:00 2001 From: vshepard Date: Tue, 4 Jun 2024 20:42:40 +0200 Subject: [PATCH] Update establish_ssh_tunnel --- testgres/operations/remote_ops.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testgres/operations/remote_ops.py b/testgres/operations/remote_ops.py index 8e4ccfc2..4582d93c 100644 --- a/testgres/operations/remote_ops.py +++ b/testgres/operations/remote_ops.py @@ -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, @@ -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.")