]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/ceph_manager: capture stderr for COT
authorKefu Chai <kchai@redhat.com>
Sun, 8 Mar 2020 05:39:59 +0000 (13:39 +0800)
committerDeepika Upadhyay <dupadhya@redhat.com>
Tue, 8 Dec 2020 14:21:17 +0000 (19:51 +0530)
as we are expecting the error message written to stderr, and we need to
check for the error messages in it.

this change addresses the regression introduced by
204ceee156cbb8a20bdf56efb0cd0610ee4c107e

Fixes: https://tracker.ceph.com/issues/44500
Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/ceph_manager.py

index 130182f25dab5216d0a7cfd1105a45f2e35bf87f..f8afa98835d6e56ec8fb23530f75045d7dabed93 100644 (file)
@@ -258,7 +258,8 @@ class Thrasher:
                                           stdout=BytesIO(), stderr=BytesIO())
                     if proc.exitstatus == 0:
                         break
-                    elif proc.exitstatus == 1 and proc.stderr == b"OSD has the store locked":
+                    elif (proc.exitstatus == 1 and
+                          six.ensure_str(proc.stderr.getvalue()) == "OSD has the store locked"):
                         continue
                     else:
                         raise Exception("ceph-objectstore-tool: "
@@ -324,8 +325,8 @@ class Thrasher:
             proc = imp_remote.run(args=cmd, wait=True, check_status=False,
                                   stderr=BytesIO())
             if proc.exitstatus == 1:
-                bogosity = b"The OSD you are using is older than the exported PG"
-                if bogosity in proc.stderr.getvalue():
+                bogosity = "The OSD you are using is older than the exported PG"
+                if bogosity in six.ensure_str(proc.stderr.getvalue()):
                     self.log("OSD older than exported PG"
                              "...ignored")
             elif proc.exitstatus == 10: