From: Redouane Kachach Date: Mon, 3 Apr 2023 16:34:25 +0000 (+0200) Subject: mgr/cephadm: use SFTP instead of SCP to copy cephadm remote files X-Git-Tag: v19.0.0~1446^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=99148b4a183f54a8779edbf529dfb34bba67e2a9;p=ceph.git mgr/cephadm: use SFTP instead of SCP to copy cephadm remote files fixes: https://tracker.ceph.com/issues/59298 Signed-off-by: Redouane Kachach --- diff --git a/src/pybind/mgr/cephadm/ssh.py b/src/pybind/mgr/cephadm/ssh.py index 8134cc0d9444b..4023a1cde802a 100644 --- a/src/pybind/mgr/cephadm/ssh.py +++ b/src/pybind/mgr/cephadm/ssh.py @@ -237,7 +237,8 @@ class SSHManager: f.write(content) f.flush() conn = await self._remote_connection(host, addr) - await asyncssh.scp(f.name, (conn, tmp_path)) + async with conn.start_sftp_client() as sftp: + await sftp.put(f.name, tmp_path) if uid is not None and gid is not None and mode is not None: # shlex quote takes str or byte object, not int await self._check_execute_command(host, ['chown', '-R', str(uid) + ':' + str(gid), tmp_path], addr=addr)