From 342c056ae41fdf4f8dc0496c6c23507905fe980a Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 06 2020 08:46:45 +0000 Subject: nagios_client: Fix the check_ipa_replication plugin It looks like the data it retrieves is in bytes and thus needs to be decoded into a unicode string so we can use it as a regular string in our code later. Fixes https://pagure.io/fedora-infrastructure/issue/9372 Signed-off-by: Pierre-Yves Chibon --- diff --git a/roles/nagios_client/files/scripts/check_ipa_replication b/roles/nagios_client/files/scripts/check_ipa_replication index 5d82c1a..830a6a6 100644 --- a/roles/nagios_client/files/scripts/check_ipa_replication +++ b/roles/nagios_client/files/scripts/check_ipa_replication @@ -49,7 +49,7 @@ except Exception as e: for rhost in replication: plugin.add_summary("Replica %s Status: %s" % (rhost[1]['nsDS5ReplicaHost'][0], rhost[1]['nsds5replicaLastUpdateStatus'][0])) - status = rhost[1]['nsds5replicaLastUpdateStatus'][0] + status = rhost[1]['nsds5replicaLastUpdateStatus'][0].decode('utf-8') code = status[:2] if status.startswith('Error ('): # IPA >=4.4.0