From 5cafe02168c5ccd18dac9dbfe493cc6b73dd206d Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 27 Jan 2021 12:52:10 +0800 Subject: [PATCH] mgr/zabbix: talk to zabbix_sender in text not bytes as we expect read from / write to it in text mode. Signed-off-by: Kefu Chai --- src/pybind/mgr/zabbix/module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/zabbix/module.py b/src/pybind/mgr/zabbix/module.py index 37f8b9ba39e..c16b98cfb10 100644 --- a/src/pybind/mgr/zabbix/module.py +++ b/src/pybind/mgr/zabbix/module.py @@ -37,11 +37,11 @@ class ZabbixSender(object): self.log.debug('Executing: %s', cmd) - proc = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) + proc = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE, encoding='utf-8') for key, value in data.items(): assert proc.stdin - proc.stdin.write('{0} ceph.{1} {2}\n'.format(hostname, key, value).encode('utf-8')) + proc.stdin.write('{0} ceph.{1} {2}\n'.format(hostname, key, value)) stdout, stderr = proc.communicate() if proc.returncode != 0: -- 2.47.3