ceph-nagios-plugins
ceph-nagios-plugins copied to clipboard
check_ceph_osd_db: Decode bytes output to string
Avoids TypeError: cannot use a string pattern on a bytes-like object
when executing re.findall()
.
Popen.communicate()
returns bytes if the streams weren't opened in text mode, which is not the case here, as far as I can tell. See https://docs.python.org/3/library/subprocess.html#subprocess.Popen.communicate
Noted this issue and it fixed the problem for me.