]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
cephfs-shell: reuse code
authorRishabh Dave <ridave@redhat.com>
Tue, 20 Aug 2019 12:18:07 +0000 (17:48 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 13 Sep 2019 05:15:46 +0000 (10:45 +0530)
Make path_to_bytes.__call__() call to_bytes() and get rid of the code
within path_to_bytes.__call__().

Signed-off-by: Rishabh Dave <ridave@redhat.com>
src/tools/cephfs/cephfs-shell

index 0354755118c517f698d99362df9804ab0ca0ffe9..031aee86367b984f8d86e81217a679380e9e9b1d 100755 (executable)
@@ -414,10 +414,7 @@ class CephFSShell(Cmd):
 
     class path_to_bytes(argparse.Action):
         def __call__(self, parser, namespace, values, option_string=None):
-            if isinstance(values, str):
-                values = to_bytes(values)
-            if isinstance(values, list):
-                values = list(map(to_bytes, values))
+            values = to_bytes(values)
             setattr(namespace, self.dest, values)
 
     def complete_mkdir(self, text, line, begidx, endidx):