Skip to content

Commit 013b359

Browse files
author
vshepard
committed
Add tunnel_port to remote_ops.py
1 parent 22d3251 commit 013b359

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

testgres/operations/remote_ops.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def __init__(self, conn_params: ConnectionParams):
5656
self.remote = True
5757
self.username = conn_params.username or self.get_user()
5858
self.tunnel_process = None
59+
self.tunnel_port = None
5960

6061
def __enter__(self):
6162
return self
@@ -408,6 +409,7 @@ def db_connect(self, dbname, user, password=None, host="localhost", port=5432):
408409
Establish SSH tunnel and connect to a PostgreSQL database.
409410
"""
410411
local_port = reserve_port()
412+
self.tunnel_port = local_port
411413
self.establish_ssh_tunnel(local_port=local_port, remote_port=port)
412414
try:
413415
conn = pglib.connect(

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy