From: Rishabh Dave Date: Thu, 27 Jun 2019 13:23:34 +0000 (+0530) Subject: cephfs-shell: cd with no args shouldn't print an error message X-Git-Tag: v15.1.0~2061^2~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6e3f5c441233629b48296a21a966346d13fc6782;p=ceph-ci.git cephfs-shell: cd with no args shouldn't print an error message Instead the current working directory should change to root when no argument is passed to cd. Fixes: http://tracker.ceph.com/issues/40476 Signed-off-by: Rishabh Dave --- diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index 6d8c7388219..422d0495fb6 100755 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -896,7 +896,8 @@ sub-directories, files') return self.complete_filenames(text, line, begidx, endidx) cd_parser = argparse.ArgumentParser(description='Change working directory') - cd_parser.add_argument('path', type=str, help='Name of the directory.', default='/') + cd_parser.add_argument('path', type=str, help='Name of the directory.', + nargs='?', default='/') @with_argparser(cd_parser) def do_cd(self, args):