From: huanwen ren Date: Wed, 10 Oct 2018 10:30:54 +0000 (+0800) Subject: cephfs-shell: fixup 'str' object has no attribute 'decode' X-Git-Tag: v14.0.1~35^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=af06b0cd438e5f7c6ff0cfe88afb7000681917da;p=ceph.git cephfs-shell: fixup 'str' object has no attribute 'decode' Fixes: http://tracker.ceph.com/issues/36368 Signed-off-by: huanwen ren --- diff --git a/src/tools/cephfs/cephfs-shell b/src/tools/cephfs/cephfs-shell index def2dc3517c8..c535df539dac 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: