From ba1e27000349f7fc72997e44e8e0acfcc92f8832 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Tue, 20 Aug 2019 17:48:07 +0530 Subject: [PATCH] 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 --- src/tools/cephfs/cephfs-shell | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index 0354755118c51..031aee86367b9 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): -- 2.39.5