From: Varsha Rao Date: Wed, 19 Jun 2019 10:43:46 +0000 (+0530) Subject: cephfs-shell: Add error message for invalid ls commands X-Git-Tag: v15.1.0~1889^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b98242173aa0f44aff0bae3baa70aa2c13e457c2;p=ceph-ci.git cephfs-shell: Add error message for invalid ls commands 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 --- diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index ba4014a3b41..d5c9622f054 100755 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -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):