Skip to content

Commit e8f4da9

Browse files
author
vshepard
committed
Add port to connection parameters
1 parent 8a25cb3 commit e8f4da9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

testgres/operations/os_ops.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010

1111

1212
class ConnectionParams:
13-
def __init__(self, host='127.0.0.1', ssh_key=None, username=None):
13+
def __init__(self, host='127.0.0.1', port=None, ssh_key=None, username=None):
1414
self.host = host
15+
self.port = port
1516
self.ssh_key = ssh_key
1617
self.username = username
1718

testgres/operations/remote_ops.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,13 @@ def __init__(self, conn_params: ConnectionParams):
4747
self.conn_params = conn_params
4848
self.host = conn_params.host
4949
self.ssh_key = conn_params.ssh_key
50+
self.port = conn_params.port
5051
if self.ssh_key:
5152
self.ssh_cmd = ["-i", self.ssh_key]
5253
else:
5354
self.ssh_cmd = []
55+
if self.port:
56+
self.ssh_cmd = ["-p", self.port]
5457
self.remote = True
5558
self.username = conn_params.username or self.get_user()
5659
self.add_known_host(self.host)

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