From c1d33594ca424b56a34200a6e525cdb1317bad69 Mon Sep 17 00:00:00 2001 From: Yoann QUERET Date: Mon, 18 Jan 2021 11:03:37 +0100 Subject: Make stats_dabmux_munin.py python3 comptabile --- doc/stats_dabmux_munin.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc/stats_dabmux_munin.py') diff --git a/doc/stats_dabmux_munin.py b/doc/stats_dabmux_munin.py index c750d5b..1d08321 100755 --- a/doc/stats_dabmux_munin.py +++ b/doc/stats_dabmux_munin.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # # present statistics from dabmux Stats Server and ZeroMQ RC # to munin. Expects Stats server on port 12720 and ZeroMQ RC @@ -121,7 +121,7 @@ class RCException(Exception): def do_transaction(command, sock): """To a send + receive transaction, quit whole program on timeout""" - sock.send(command) + sock.send(command.encode("utf-8")) poller = zmq.Poller() poller.register(sock, zmq.POLLIN) @@ -129,7 +129,7 @@ def do_transaction(command, sock): socks = dict(poller.poll(1000)) if socks: if socks.get(sock) == zmq.POLLIN: - return sock.recv() + return sock.recv().decode("utf-8") sys.stderr.write("Could not receive data for command '{}'\n".format(command)) sys.exit(1) -- cgit v1.2.3