Update haproxy-statsd to python3
Change-Id: I1b5c15f0c47a4bf1261abaf6d4e336aad5339c5b
This commit is contained in:
parent
5faf89f566
commit
8ebe74e512
@ -120,11 +120,11 @@ class HAProxy(object):
|
|||||||
|
|
||||||
def command(self, command):
|
def command(self, command):
|
||||||
with self.socket as socket:
|
with self.socket as socket:
|
||||||
socket.send(command + '\n')
|
socket.send((command + '\n').encode('utf8'))
|
||||||
data = ''
|
data = ''
|
||||||
while True:
|
while True:
|
||||||
r = socket.recv(4096)
|
r = socket.recv(4096)
|
||||||
data += r
|
data += r.decode('utf8')
|
||||||
if not r:
|
if not r:
|
||||||
break
|
break
|
||||||
return data
|
return data
|
||||||
|
Loading…
Reference in New Issue
Block a user