From: Rishabh Dave Date: Tue, 20 Aug 2019 12:18:07 +0000 (+0530) Subject: cephfs-shell: reuse code X-Git-Tag: v15.1.0~1555^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ba1e27000349f7fc72997e44e8e0acfcc92f8832;p=ceph.git cephfs-shell: reuse code Make path_to_bytes.__call__() call to_bytes() and get rid of the code within path_to_bytes.__call__(). Signed-off-by: Rishabh Dave --- diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index 0354755118c..031aee86367 100755 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -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):