]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephfs-shell: cd with no args shouldn't print an error message
authorRishabh Dave <ridave@redhat.com>
Thu, 27 Jun 2019 13:23:34 +0000 (18:53 +0530)
committerRishabh Dave <ridave@redhat.com>
Thu, 25 Jul 2019 05:06:38 +0000 (10:36 +0530)
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>
src/tools/cephfs/cephfs-shell

index 6d8c73882197607867945a89417209694776051a..422d0495fb6fe29e550329b3d914abc1a73e5e3c 100755 (executable)
@@ -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):