Support IPv6 with zuul_stream

It is possible the IP address passed into zuul_stream is IPv6. Switch
to using socket.create_connection as it will resolve both ipv4 / ipv6.

Change-Id: I4a4fc5e9d49b66851cc4e5806670b8ee70fa9012
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2017-09-03 18:30:51 -04:00
parent 2463f3c19e
commit 974fe0ddbc
No known key found for this signature in database
GPG Key ID: 611A80832067AF38
1 changed files with 1 additions and 2 deletions

View File

@ -134,10 +134,9 @@ class CallbackModule(default.CallbackModule):
def _read_log(self, host, ip, log_id, task_name, hosts):
self._log("[%s] Starting to log %s for task %s"
% (host, log_id, task_name), job=False, executor=True)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
while True:
try:
s.connect((ip, LOG_STREAM_PORT))
s = socket.create_connection((ip, LOG_STREAM_PORT))
except Exception:
self._log("[%s] Waiting on logger" % host,
executor=True, debug=True)