From de45b97f98f67ec30cd0af099db1b5d64af613ed Mon Sep 17 00:00:00 2001 From: Sanjay Chari Date: Mon, 29 Nov 2021 17:18:35 +0530 Subject: [PATCH] Fix in collectd pacemaker monitoring plugin readlines() function in Python 3 returns list of byte objects instead of list of str objects. Since we shifted to centos 8 for collectd containers, Python 3 is used by collectd Python plugins. This patch fixes the issue that occured because of the change, by decoding the byte objects to utf-8. Change-Id: Ifff2c7c6c7d9adfcb524ed279e2a82aedfd4ce30 --- .../collectd-openstack/files/collectd_pacemaker_monitoring.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browbeat-containers/collectd-openstack/files/collectd_pacemaker_monitoring.py b/browbeat-containers/collectd-openstack/files/collectd_pacemaker_monitoring.py index 462a752b2..923c58eab 100644 --- a/browbeat-containers/collectd-openstack/files/collectd_pacemaker_monitoring.py +++ b/browbeat-containers/collectd-openstack/files/collectd_pacemaker_monitoring.py @@ -22,7 +22,7 @@ def read_func(): os.system('''echo "pcs status" > '''+PIPE_FILE_PATH) with open(LOG_FILE_PATH, 'rb') as f: - full_output = f.readlines() + full_output = [line.decode("utf-8") for line in f.readlines()] latest_output = []