From: Kefu Chai Date: Sun, 5 Apr 2020 15:59:06 +0000 (+0800) Subject: qa/tasks/cephfs: return ascii decoded xattr X-Git-Tag: v15.2.4~42^2~71 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c6105566da5085f50bcec33c67344d2da77302f2;p=ceph.git qa/tasks/cephfs: return ascii decoded xattr as callers of `TestForwardScrub._read_str_xattr()` expects str. Signed-off-by: Kefu Chai (cherry picked from commit 7f48f61bdc8f88e1025796aec5158bbd69b1eb65) --- diff --git a/qa/tasks/cephfs/test_forward_scrub.py b/qa/tasks/cephfs/test_forward_scrub.py index 6eb31b244df..a15711a437b 100644 --- a/qa/tasks/cephfs/test_forward_scrub.py +++ b/qa/tasks/cephfs/test_forward_scrub.py @@ -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 = {}