Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions aexpect/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ def remote_copy(
Transfer files using rsync or SCP, given a command line.

:param command: The command to execute
(e.g. "rsync -avz -e 'ssh -p 22' /local/path user@host:/remote/path"
(e.g. "rsync -avz -e 'ssh -Tp 22' /local/path user@host:/remote/path"
or "scp -r foobar root@localhost:/tmp/").
:param password_list: Password list to send in reply to a password prompt.
:param log_filename: If specified, log all output to this file
Expand Down Expand Up @@ -935,7 +935,7 @@ def rsync_to_remote(
if directory:
command += " -r"
command += (
f" -avz -e 'ssh -p {port} -o UserKnownHostsFile=/dev/null "
f" -avz -e 'ssh -Tp {port} -o UserKnownHostsFile=/dev/null "
f"-o StrictHostKeyChecking=no' {limit} "
f"{quote_path(local_path)} {username}@{host}:{shlex.quote(remote_path)}"
)
Expand Down Expand Up @@ -992,7 +992,7 @@ def rsync_from_remote(
if directory:
command += " -r"
command += (
f" -avz -e 'ssh -p {port} -o UserKnownHostsFile=/dev/null "
f" -avz -e 'ssh -Tp {port} -o UserKnownHostsFile=/dev/null "
f"-o StrictHostKeyChecking=no' {limit} "
f"{username}@{host}:{quote_path(remote_path)} {shlex.quote(local_path)}"
)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def test_rsync_to_remote(self, mock_remote_copy):
)
self.assertEqual(
mock_remote_copy.call_args[0][0].command,
r"rsync -r -avz -e 'ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' /local/path user@127.0.0.1:/remote/path",
r"rsync -r -avz -e 'ssh -Tp 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' /local/path user@127.0.0.1:/remote/path",
)

@mock.patch("aexpect.remote._remote_copy")
Expand Down Expand Up @@ -129,5 +129,5 @@ def test_rsync_from_remote(self, mock_remote_copy):
)
self.assertEqual(
mock_remote_copy.call_args[0][0].command,
r"rsync -r -avz -e 'ssh -p 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' user@127.0.0.1:/remote/path /local/path",
r"rsync -r -avz -e 'ssh -Tp 22 -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' user@127.0.0.1:/remote/path /local/path",
)
Loading