From 265803dd568b3a363e9a4dfd5ea156965f4f67ae Mon Sep 17 00:00:00 2001 From: Tobias Henkel Date: Tue, 6 Nov 2018 07:38:12 +0100 Subject: [PATCH] Improve windows logging Currently we don't have any stdout logs with windows at all in the buildlog but only in the json log. This is a little bit inconvenient. As live streaming doesn't work at the moment for windows just don't live stream win_shell and win_command tasks but treat them similar to localhost tasks and loop items. With this we at least get after the fact stdout logs of these tasks. Change-Id: Ieda6cb51dd6af0d5fb4d0a1f6f7d60d66c9fd7cb --- zuul/ansible/callback/zuul_stream.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/zuul/ansible/callback/zuul_stream.py b/zuul/ansible/callback/zuul_stream.py index 32d40ca802..3a6cae716d 100644 --- a/zuul/ansible/callback/zuul_stream.py +++ b/zuul/ansible/callback/zuul_stream.py @@ -281,9 +281,13 @@ class CallbackModule(default.CallbackModule): if not is_localhost and is_task: self._stop_streamers() - if result._task.action in ('command', 'shell'): + if result._task.action in ('command', 'shell', + 'win_command', 'win_shell'): stdout_lines = zuul_filter_result(result_dict) - if is_localhost: + # We don't have streaming for localhost and windows modules so get + # standard out after the fact. + if is_localhost or result._task.action in ( + 'win_command', 'win_shell'): for line in stdout_lines: hostname = self._get_hostname(result) self._log("%s | %s " % (hostname, line)) @@ -452,7 +456,8 @@ class CallbackModule(default.CallbackModule): self._log_message( result, status='MODULE FAILURE', msg="Item: {item}\n{module_stdout}".format(**result_dict)) - elif result._task.action not in ('command', 'shell'): + elif result._task.action not in ('command', 'shell', + 'win_command', 'win_shell'): if 'msg' in result_dict: self._log_message( result=result, msg=result_dict['msg'], status=status) @@ -490,7 +495,8 @@ class CallbackModule(default.CallbackModule): self._log_message( result, status='MODULE FAILURE', msg="Item: {item}\n{module_stdout}".format(**result_dict)) - elif result._task.action not in ('command', 'shell'): + elif result._task.action not in ('command', 'shell', + 'win_command', 'win_shell'): self._log_message( result=result, msg="Item: {item}".format(item=result_dict['item']),