Skip to content

Commit c92794c

Browse files
author
vshepard
committed
Add port to connection parameters
1 parent 356cd52 commit c92794c

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
@@ -45,10 +45,13 @@ def __init__(self, conn_params: ConnectionParams):
4545
self.conn_params = conn_params
4646
self.host = conn_params.host
4747
self.ssh_key = conn_params.ssh_key
48+
self.port = conn_params.port
4849
if self.ssh_key:
4950
self.ssh_cmd = ["-i", self.ssh_key]
5051
else:
5152
self.ssh_cmd = []
53+
if self.port:
54+
self.ssh_cmd = ["-p", self.port]
5255
self.remote = True
5356
self.username = conn_params.username or self.get_user()
5457
self.add_known_host(self.host)

0 commit comments

Comments
 (0)