From 2dad1b96a0aa97ed8acc45f71dc65c57734fcc1f Mon Sep 17 00:00:00 2001 From: Milind Changire Date: Sat, 13 Apr 2019 10:34:06 +0530 Subject: [PATCH] cephfs-shell: fix chdir command Signed-off-by: Milind Changire --- src/tools/cephfs/cephfs-shell | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index b2f039ce6ca..49635b2b433 100755 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -825,7 +825,10 @@ sub-directories, files') else: cephfs.chdir(b'/') else: - cephfs.chdir(to_bytes(args.dir_name)) + try: + cephfs.chdir(to_bytes(args.dir_name)) + except: + self.poutput("%s: no such directory" % args.dir_name) self.working_dir = cephfs.getcwd().decode('utf-8') self.set_prompt() -- 2.39.5