]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cephfs-shell: fixup 'str' object has no attribute 'decode' 24508/head
authorhuanwen ren <ren.huanwen@zte.com.cn>
Wed, 10 Oct 2018 10:30:54 +0000 (18:30 +0800)
committerhuanwen ren <ren.huanwen@zte.com.cn>
Thu, 11 Oct 2018 09:27:59 +0000 (17:27 +0800)
Fixes: http://tracker.ceph.com/issues/36368
Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
src/tools/cephfs/cephfs-shell

index def2dc3517c8575b39348375f64f432fc3d83e1d..c535df539dacf7894bc400050b92b545ae11bebc 100644 (file)
@@ -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: