]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.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)
committerKefu Chai <kchai@redhat.com>
Sun, 8 Mar 2020 06:43:13 +0000 (14:43 +0800)
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 aea091f65cf4f0f1702e967021a13e5ea9205a81..68f1c84d8775f13d9fc5b1908be7b346e2af773c 100644 (file)
@@ -306,7 +306,8 @@ class OSDThrasher(Thrasher):
                         ])
                     if proc.exitstatus == 0:
                         break
-                    elif proc.exitstatus == 1 and proc.stderr == "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: "
@@ -418,7 +419,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:
@@ -453,8 +454,10 @@ class OSDThrasher(Thrasher):
                                '--journal-path', JPATH.format(id=imp_osd),
                            ])
                            + " --op apply-layout-settings --pool " + pool).format(id=osd)
-                    output = imp_remote.sh(cmd, wait=True, check_status=False)
-                    if 'Couldn\'t find pool' in output:
+                    proc = imp_remote.run(args=cmd,
+                                          wait=True, check_status=False,
+                                          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"