Skip to content

Commit fffb23c

Browse files
author
vshepard
committed
Add tunnel_port to remote_ops.py
1 parent 48594f6 commit fffb23c

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
@@ -58,6 +58,7 @@ def __init__(self, conn_params: ConnectionParams):
5858
self.remote = True
5959
self.username = conn_params.username or self.get_user()
6060
self.tunnel_process = None
61+
self.tunnel_port = None
6162

6263
def __enter__(self):
6364
return self
@@ -410,6 +411,7 @@ def db_connect(self, dbname, user, password=None, host="localhost", port=5432):
410411
Establish SSH tunnel and connect to a PostgreSQL database.
411412
"""
412413
local_port = reserve_port()
414+
self.tunnel_port = local_port
413415
self.establish_ssh_tunnel(local_port=local_port, remote_port=port)
414416
try:
415417
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