cephfs-shell: creates directories in local file system even if file not found
The "get" command in cephfs-shell when used to get a file that doesn't exist on ceph filesystem, would throw an error but still would create a directory in the local filesystem:
CephFS:~/>>> get foo /home/dparmar/foo opendir failed at foo: No such file or directory [Errno 2]
Upon doing "ls" in local filesystem:
[dparmar@fedora ~]$ ls ceph-prs-repo demo Documents file1 Music Public quickceph sepia-vpn-client.tar.gz ticket_wfh cephrunrepo Desktop Downloads foo Pictures pycharm.sh rh_resources Templates Videos
It creates directory /home/dparmar/foo/foo which is basically empty.
Solution: There's a block of code in do_get() that upon finding ZERO files, does
which basically would create this kind of directories. This code can be eliminated and instead directly thrown an error something like "file doesn't exist" and return.
os.makedirs(root_dst_dir + b'/' + root_src_dir)