]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/zabbix: encode string for Python 3 compatibility 30016/head
authorNathan Cutler <ncutler@suse.com>
Tue, 18 Jun 2019 08:10:30 +0000 (10:10 +0200)
committerNathan Cutler <ncutler@suse.com>
Thu, 29 Aug 2019 21:31:43 +0000 (23:31 +0200)
Credits to Jochem Kuijpers for the fix.

Fixes: https://tracker.ceph.com/issues/36318
Signed-off-by: Nathan Cutler <ncutler@suse.com>
(cherry picked from commit 20966a3d7253cb1b2ac3339306e2b9b71a6d7ea3)

src/pybind/mgr/zabbix/module.py

index 6b428dc0acca57016f2b06b51ac1aea22ab0b241..f12e63a91af4f920199025efdceaa34eccc7a57d 100644 (file)
@@ -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: