]> 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>
Sun, 14 Jun 2020 08:34:52 +0000 (16:34 +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 6eb31b244df4601e7a0245c7671f7e71b8425f20..a15711a437bd2217be43f0fcce1d5afd3178dc1a 100644 (file)
@@ -10,6 +10,8 @@ how the functionality responds to damaged metadata.
 import json
 
 import logging
+import six
+
 from collections import namedtuple
 from textwrap import dedent
 
@@ -33,7 +35,7 @@ class TestForwardScrub(CephFSTestCase):
         """
         output = self.fs.rados(["getxattr", obj, attr], pool=pool)
         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 = {}