]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs: return ascii decoded xattr
authorKefu Chai <kchai@redhat.com>
Sun, 5 Apr 2020 15:59:06 +0000 (23:59 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 3 Jun 2020 11:56:59 +0000 (19:56 +0800)
as callers of `TestForwardScrub._read_str_xattr()` expects str.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 7f48f61bdc8f88e1025796aec5158bbd69b1eb65)

qa/tasks/cephfs/test_forward_scrub.py

index 94e99d3101d029fddefd1dbea89f2f2e6bd65a22..cc861b385a40cf2ea38ebcb307639fd67f08954e 100644 (file)
@@ -10,6 +10,8 @@ how the functionality responds to damaged metadata.
 import json
 
 import logging
+import six
+
 from collections import namedtuple
 from io import BytesIO
 from textwrap import dedent
@@ -35,7 +37,7 @@ class TestForwardScrub(CephFSTestCase):
         output = self.fs.rados(["getxattr", obj, attr], pool=pool,
                                stdout_data=BytesIO())
         strlen = struct.unpack('i', output[0:4])[0]
-        return output[4:(4 + strlen)]
+        return six.ensure_str(output[4:(4 + strlen)], encoding='ascii')
 
     def _get_paths_to_ino(self):
         inos = {}