]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/vstart_runner: remove the stdin str type check
authorXiubo Li <xiubli@redhat.com>
Thu, 23 Apr 2020 11:39:31 +0000 (07:39 -0400)
committerKefu Chai <kchai@redhat.com>
Wed, 3 Jun 2020 11:57:00 +0000 (19:57 +0800)
For the "ceph-dencoder" it will use the byte type data.

Signed-off-by: Xiubo Li <xiubli@redhat.com>
(cherry picked from commit bf10478294e26dc785dd79b0367bf096e9f67b42)

qa/tasks/cephfs/filesystem.py
qa/tasks/vstart_runner.py

index 4b8b0c719a1aac0b5805193e6edece6673b72339..4be74abfded91dad692ea82687e8bf09ddefbe72 100644 (file)
@@ -1065,7 +1065,7 @@ class Filesystem(MDSCluster):
             os.path.join(self._prefix, "rados"), "-p", pool, "getxattr", obj_name, xattr_name
         ]
         try:
-            proc = remote.run(args=args, stdout=StringIO())
+            proc = remote.run(args=args, stdout=BytesIO())
         except CommandFailedError as e:
             log.error(e.__str__())
             raise ObjectNotFound(obj_name)
index 481db91216b12ce971faa35e5a62ae11f54b5063..0e0183778678e794f290e2ea92ea2f7b3d5dd157 100644 (file)
@@ -291,12 +291,12 @@ class LocalRemote(object):
                                        env=env)
 
         if stdin:
-            if not isinstance(stdin, str):
-                raise RuntimeError("Can't handle non-string stdins on a vstart cluster")
-
             # Hack: writing to stdin is not deadlock-safe, but it "always" works
             # as long as the input buffer is "small"
-            subproc.stdin.write(stdin.encode())
+            if isinstance(stdin, str):
+                subproc.stdin.write(stdin.encode())
+            else:
+                subproc.stdin.write(stdin)
 
         proc = LocalRemoteProcess(
             args, subproc, check_status,