From af06b0cd438e5f7c6ff0cfe88afb7000681917da Mon Sep 17 00:00:00 2001 From: huanwen ren Date: Wed, 10 Oct 2018 18:30:54 +0800 Subject: [PATCH] cephfs-shell: fixup 'str' object has no attribute 'decode' Fixes: http://tracker.ceph.com/issues/36368 Signed-off-by: huanwen ren --- src/tools/cephfs/cephfs-shell | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index def2dc3517c85..c535df539dacf 100644 --- a/src/tools/cephfs/cephfs-shell +++ b/src/tools/cephfs/cephfs-shell @@ -568,8 +568,7 @@ exists.') items = sorted(list_items(dir_name), key=lambda item: item.d_name) if not args.all and len(items) > 2: - items = [i for i in items if not i.d_name.decode( - 'utf-8').startswith('.')] + items = [i for i in items if not i.d_name.startswith('.')] flag = 0 if args.S: items = sorted(items, key=lambda item: cephfs.stat( @@ -579,7 +578,7 @@ exists.') for item in items: path = item if not isinstance(item, str): - path = item.d_name.decode('utf-8') + path = item.d_name if item.is_dir(): is_dir = True else: -- 2.39.5