]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-shell: get command should never create a directory on its own
authordparmar18 <dparmar@redhat.com>
Wed, 6 Apr 2022 14:41:06 +0000 (20:11 +0530)
committerdparmar18 <dparmar@redhat.com>
Wed, 11 May 2022 11:46:28 +0000 (17:16 +0530)
Descrption: When using the get command on a single file, it would append the remote path to
            source path and create directories that shouldn't be created. For instance,
            file 'foo.txt' resides at `/dir1/dir2/` and `get` command is used to copy it to
            /tmp/foo then it would do `/tmp/dir1/dir2/foo.txt` which is not the expected
            behavior. Therefore this PR intends to correct this behavior.

Fixes: https://tracker.ceph.com/issues/55112
Signed-off-by: Dhairya Parmar <dparmar@redhat.com>
src/tools/cephfs/cephfs-shell

index 83be25c528db489ff4ecf75dff4f68a1cfd1372d..8ab719422dbdd1709d5c3b2b4303e80a069df47c 100755 (executable)
@@ -743,8 +743,7 @@ class CephFSShell(Cmd):
                 return
             copy_to_local(root_src_dir, b'-')
         elif is_file_exists(args.remote_path):
-            copy_to_local(root_src_dir,
-                          root_dst_dir + b'/' + root_src_dir)
+            copy_to_local(root_src_dir, root_dst_dir)
         elif b'/' in root_src_dir and is_file_exists(fname[1], fname[0]):
             copy_to_local(root_src_dir, root_dst_dir)
         else: