]> git.apps.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, 3 Nov 2020 09:19:29 +0000 (14:49 +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>
(cherry picked from commit 78308f7207a7129aaba01ea8c27e2f563d688318)

qa/tasks/ceph_manager.py

index a5050cf2a3010bab180e75399a131203f8d99ab8..6a49bcb86689e5d7133d7776d16a9c15891eaae0 100644 (file)
@@ -305,7 +305,7 @@ class OSDThrasher(Thrasher):
                     if proc.exitstatus == 0:
                         break
                     elif (proc.exitstatus == 1 and
-                          proc.stderr.getvalue() == "OSD has the store locked"):
+                          six.ensure_str(proc.stderr.getvalue()) == "OSD has the store locked"):
                         continue
                     else:
                         raise Exception("ceph-objectstore-tool: "
@@ -417,7 +417,7 @@ class OSDThrasher(Thrasher):
                 ])
             if proc.exitstatus == 1:
                 bogosity = "The OSD you are using is older than the exported PG"
-                if bogosity in proc.stderr.getvalue():
+                if bogosity in six.ensure_str(proc.stderr.getvalue()):
                     self.log("OSD older than exported PG"
                              "...ignored")
             elif proc.exitstatus == 10:
@@ -454,8 +454,8 @@ class OSDThrasher(Thrasher):
                            + " --op apply-layout-settings --pool " + pool).format(id=osd)
                     proc = imp_remote.run(args=cmd,
                                           wait=True, check_status=False,
-                                          stderr=StringIO())
-                    if 'Couldn\'t find pool' in proc.stderr.getvalue():
+                                          stderr=BytesIO)
+                    if 'Couldn\'t find pool' in six.ensure_str(proc.stderr.getvalue()):
                         continue
                     if proc.exitstatus:
                         raise Exception("ceph-objectstore-tool apply-layout-settings"