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 <ridave@redhat.com>
This commit is contained in:
Rishabh Dave 2019-06-27 18:53:34 +05:30
parent a29700e5e7
commit 6e3f5c4412

View File

@ -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):