]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephfs-shell: Add error message for invalid ls commands
authorVarsha Rao <varao@redhat.com>
Wed, 19 Jun 2019 10:43:46 +0000 (16:13 +0530)
committerroot <root@localhost.localdomain>
Wed, 31 Jul 2019 18:29:40 +0000 (23:59 +0530)
This patch prints the following error message on invalid ls command:

CephFS:~/>>> ls
t/   u/   y
CephFS:~/>>> ls k
k: no such directory exists

Fixes: https://tracker.ceph.com/issues/40430
Signed-off-by: Varsha Rao <varao@redhat.com>
src/tools/cephfs/cephfs-shell

index ba4014a3b41ab9b1d5c464c33b7cc73f60c81302..d5c9622f05409325e425f8e6cd86931506c883e7 100755 (executable)
@@ -117,8 +117,9 @@ def ls(path, opts=''):
                 elif almost_all and dent.d_name in (b'.', b'..'):
                     continue
                 yield dent
-    except cephfs.ObjectNotFound:
-        return []
+    except libcephfs.ObjectNotFound:
+        perror('{}: no such directory exists'.format(path), end='\n',
+               apply_style=True)
 
 
 def glob(path, pattern):