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>
diff --git a/zuul/ansible/callback/zuul_stream.py b/zuul/ansible/callback/zuul_stream.py
index 906f052..6aec86b 100644
--- a/zuul/ansible/callback/zuul_stream.py
+++ b/zuul/ansible/callback/zuul_stream.py
@@ -134,10 +134,9 @@
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)