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
No known key found for this signature in database
GPG Key ID: 22A2A94B5E49415A

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