]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephfs: use BytesIO for capturing binary
authorKefu Chai <kchai@redhat.com>
Sun, 5 Apr 2020 13:16:10 +0000 (21:16 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 7 Apr 2020 13:51:22 +0000 (21:51 +0800)
this change partially reverts e46eb8348e0639ea162b7e224bca40e0257ad6ef.

xattrs could contain non-utf8 encoded data, and should be captured using
BytesIO. moreover, it will be fed to `ceph-dencoder`, which expects
binary when performing "import".

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/cephfs/filesystem.py

index 18aa118eaebfcb9caecc54897dcb3899d8a2f757..dc811fe8d47e2cb583900af3fb801eeb943eb95d 100644 (file)
@@ -10,6 +10,8 @@ import errno
 import random
 import traceback
 
+from io import BytesIO
+
 from teuthology.exceptions import CommandFailedError
 from teuthology import misc
 from teuthology.nuke import clear_firewall
@@ -1091,11 +1093,12 @@ class Filesystem(MDSCluster):
             os.path.join(self._prefix, "rados"), "-p", pool, "getxattr", obj_name, xattr_name
         ]
         try:
-            data = remote.sh(args)
+            proc = remote.run(args=args, stdout=BytesIO())
         except CommandFailedError as e:
             log.error(e.__str__())
             raise ObjectNotFound(obj_name)
 
+        data = proc.stdout.getvalue()
         dump = remote.sh(
             [os.path.join(self._prefix, "ceph-dencoder"),
                                             "type", type,