From: Kefu Chai Date: Sun, 5 Apr 2020 15:59:06 +0000 (+0800) Subject: qa/tasks/cephfs: return ascii decoded xattr X-Git-Tag: wip-pdonnell-testing-20200918.022351~1585^2~28 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=7f48f61bdc8f88e1025796aec5158bbd69b1eb65;p=ceph-ci.git qa/tasks/cephfs: return ascii decoded xattr as callers of `TestForwardScrub._read_str_xattr()` expects str. Signed-off-by: Kefu Chai --- diff --git a/qa/tasks/cephfs/test_forward_scrub.py b/qa/tasks/cephfs/test_forward_scrub.py index 94e99d3101d..cc861b385a4 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 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 = {}