]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/zabbix: encode string for Python 3 compatibility 28624/head
authorNathan Cutler <ncutler@suse.com>
Tue, 18 Jun 2019 08:10:30 +0000 (10:10 +0200)
committerNathan Cutler <ncutler@suse.com>
Thu, 20 Jun 2019 08:32:36 +0000 (10:32 +0200)
Credits to Jochem Kuijpers for the fix.

Fixes: https://tracker.ceph.com/issues/36318
Signed-off-by: Nathan Cutler <ncutler@suse.com>
src/pybind/mgr/zabbix/module.py

index bd7c9c20b13a9cc63f8357bea0c92691e1796537..e864735ccc07d47c814666ed2067fbab8d7ac4b8 100644 (file)
@@ -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: