zuul_stream: avoid exception in _log_streamline
`_read_log()` calls `_log_streamline()` when it handles `socket.timeout` exception. This change ensures `_log_streamline()` don't raise another exception: ``` Traceback (most recent call last):' File "/var/lib/zuul/ansible/2.9/zuul/ansible/callback/zuul_stream.py", line 137, in _read_log' s = socket.create_connection((ip, port), 5)' File "/usr/lib/python3.6/socket.py", line 724, in create_connection' raise err' File "/usr/lib/python3.6/socket.py", line 713, in create_connection' sock.connect(sa)' socket.timeout: timed out' ' During handling of the above exception, another exception occurred:' ' Traceback (most recent call last):' File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner' self.run()' File "/usr/lib/python3.6/threading.py", line 864, in run' self._target(*self._args, **self._kwargs)' File "/var/lib/zuul/ansible/2.9/zuul/ansible/callback/zuul_stream.py", line 152, in _read_log' % (ip, port))' File "/var/lib/zuul/ansible/2.9/zuul/ansible/callback/zuul_stream.py", line 202, in _log_streamline' ts, ln = line.split(' | ', 1)" ValueError: not enough values to unpack (expected 2, got 1)' ``` Change-Id: Ifeea230d1285ab62acf11a0ed37e38e508e1dba8
This commit is contained in:
parent
bd09bc6cae
commit
2e79671991
|
@ -198,11 +198,14 @@ class CallbackModule(default.CallbackModule):
|
|||
elif "[Zuul] Log not found" in line:
|
||||
# don't output this line
|
||||
return False
|
||||
else:
|
||||
elif " | " in line:
|
||||
ts, ln = line.split(' | ', 1)
|
||||
|
||||
self._log("%s | %s " % (host, ln), ts=ts)
|
||||
return False
|
||||
else:
|
||||
self._log("%s | %s " % (host, line))
|
||||
return False
|
||||
|
||||
def _log_module_failure(self, result, result_dict):
|
||||
if 'module_stdout' in result_dict and result_dict['module_stdout']:
|
||||
|
|
Loading…
Reference in New Issue