From: Nathan Cutler Date: Tue, 18 Jun 2019 08:10:30 +0000 (+0200) Subject: mgr/zabbix: encode string for Python 3 compatibility X-Git-Tag: v14.2.5~55^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=10ec940c2427b8f3e17c57b893f71c22daf9e240;p=ceph.git mgr/zabbix: encode string for Python 3 compatibility Credits to Jochem Kuijpers for the fix. Fixes: https://tracker.ceph.com/issues/36318 Signed-off-by: Nathan Cutler (cherry picked from commit 20966a3d7253cb1b2ac3339306e2b9b71a6d7ea3) --- diff --git a/src/pybind/mgr/zabbix/module.py b/src/pybind/mgr/zabbix/module.py index 6b428dc0acca5..f12e63a91af4f 100644 --- a/src/pybind/mgr/zabbix/module.py +++ b/src/pybind/mgr/zabbix/module.py @@ -37,7 +37,7 @@ class ZabbixSender(object): proc = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE) for key, value in data.items(): - proc.stdin.write('{0} ceph.{1} {2}\n'.format(hostname, key, value)) + proc.stdin.write('{0} ceph.{1} {2}\n'.format(hostname, key, value).encode('utf-8')) stdout, stderr = proc.communicate() if proc.returncode != 0: