]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: use SFTP instead of SCP to copy cephadm remote files 50846/head
authorRedouane Kachach <rkachach@redhat.com>
Mon, 3 Apr 2023 16:34:25 +0000 (18:34 +0200)
committerRedouane Kachach <rkachach@redhat.com>
Mon, 3 Apr 2023 16:42:21 +0000 (18:42 +0200)
fixes: https://tracker.ceph.com/issues/59298

Signed-off-by: Redouane Kachach <rkachach@redhat.com>
src/pybind/mgr/cephadm/ssh.py

index 8134cc0d9444b4adb9aa06007185012a2f78e39f..4023a1cde802aab2163d413e440a36d5c9f53467 100644 (file)
@@ -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)