diff --git a/datashuttle/utils/rclone.py b/datashuttle/utils/rclone.py index 9644c103..2693d807 100644 --- a/datashuttle/utils/rclone.py +++ b/datashuttle/utils/rclone.py @@ -7,6 +7,8 @@ from datashuttle.utils import utils from datashuttle.utils.custom_types import TopLevelFolder +PORT = 3306 # TODO: direct copy! + def call_rclone(command: str, pipe_std: bool = False) -> CompletedProcess: """ @@ -99,7 +101,7 @@ def setup_rclone_config_for_ssh( f"sftp " f"host {cfg['central_host_id']} " f"user {cfg['central_host_username']} " - f"port 22 " + f"port {PORT} " f"key_file {ssh_key_path.as_posix()}", pipe_std=True, ) diff --git a/datashuttle/utils/ssh.py b/datashuttle/utils/ssh.py index 5a522354..42f2d745 100644 --- a/datashuttle/utils/ssh.py +++ b/datashuttle/utils/ssh.py @@ -14,6 +14,8 @@ import paramiko +PORT = 3306 + from datashuttle.utils import utils # ----------------------------------------------------------------------------- @@ -42,7 +44,7 @@ def connect_client_core( else None ), look_for_keys=True, - port=3306, + port=PORT, ) @@ -84,7 +86,7 @@ def get_remote_server_key(central_host_id: str): connection. """ transport: paramiko.Transport - with paramiko.Transport((central_host_id, 3306)) as transport: + with paramiko.Transport((central_host_id, PORT)) as transport: transport.connect() key = transport.get_remote_server_key() return key @@ -93,7 +95,7 @@ def get_remote_server_key(central_host_id: str): def save_hostkey_locally(key, central_host_id, hostkeys_path) -> None: client = paramiko.SSHClient() client.get_host_keys().add( - f"[{central_host_id}]:3306", key.get_name(), key + f"[{central_host_id}]:{PORT}", key.get_name(), key ) client.get_host_keys().save(hostkeys_path.as_posix())