From 94dd7c721c6ecd18f2d6df4f7d2731584e025069 Mon Sep 17 00:00:00 2001 From: Lorenz Bausch Date: Fri, 14 Oct 2022 13:14:47 +0200 Subject: [PATCH] Decode bytes output to string Avoids `TypeError: cannot use a string pattern on a bytes-like object` --- src/check_ceph_osd_db | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/check_ceph_osd_db b/src/check_ceph_osd_db index 6a01836..2f691cf 100755 --- a/src/check_ceph_osd_db +++ b/src/check_ceph_osd_db @@ -101,7 +101,7 @@ def main(): osd_host = osd_host.replace('[', '\[') osd_host = osd_host.replace(']', '\]') - osds_up = re.findall(r"^(osd\.[^ ]*) up.*%s:" % (osd_host), output, re.MULTILINE) + osds_up = re.findall(r"^(osd\.[^ ]*) up.*%s:" % (osd_host), output.decode('utf-8'), re.MULTILINE) final_status = STATUS_OK lines = []