ipautil: port host_port_open() to python 3

socket.send() expects `Bytes` instance, not string

https://pagure.io/freeipa/issue/4985

Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
Stanislav Laznicka
2017-08-17 14:59:08 +02:00
committed by Tomas Krizek
parent f7d1a10f22
commit b1fbdbefdb

View File

@@ -983,7 +983,7 @@ def host_port_open(host, port, socket_type=socket.SOCK_STREAM,
s.connect(sa)
if socket_type == socket.SOCK_DGRAM:
s.send('')
s.send(b'')
s.recv(512)
except socket.error:
port_open = False