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: v15.1.0~2382^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F28624%2Fhead;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 --- diff --git a/src/pybind/mgr/zabbix/module.py b/src/pybind/mgr/zabbix/module.py index bd7c9c20b13..e864735ccc0 100644 --- a/src/pybind/mgr/zabbix/module.py +++ b/src/pybind/mgr/zabbix/module.py @@ -38,7 +38,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: