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
This commit is contained in:
parent
0ae7a157e2
commit
265803dd56
|
@ -281,9 +281,13 @@ class CallbackModule(default.CallbackModule):
|
||||||
|
|
||||||
if not is_localhost and is_task:
|
if not is_localhost and is_task:
|
||||||
self._stop_streamers()
|
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)
|
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:
|
for line in stdout_lines:
|
||||||
hostname = self._get_hostname(result)
|
hostname = self._get_hostname(result)
|
||||||
self._log("%s | %s " % (hostname, line))
|
self._log("%s | %s " % (hostname, line))
|
||||||
|
@ -452,7 +456,8 @@ class CallbackModule(default.CallbackModule):
|
||||||
self._log_message(
|
self._log_message(
|
||||||
result, status='MODULE FAILURE',
|
result, status='MODULE FAILURE',
|
||||||
msg="Item: {item}\n{module_stdout}".format(**result_dict))
|
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:
|
if 'msg' in result_dict:
|
||||||
self._log_message(
|
self._log_message(
|
||||||
result=result, msg=result_dict['msg'], status=status)
|
result=result, msg=result_dict['msg'], status=status)
|
||||||
|
@ -490,7 +495,8 @@ class CallbackModule(default.CallbackModule):
|
||||||
self._log_message(
|
self._log_message(
|
||||||
result, status='MODULE FAILURE',
|
result, status='MODULE FAILURE',
|
||||||
msg="Item: {item}\n{module_stdout}".format(**result_dict))
|
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(
|
self._log_message(
|
||||||
result=result,
|
result=result,
|
||||||
msg="Item: {item}".format(item=result_dict['item']),
|
msg="Item: {item}".format(item=result_dict['item']),
|
||||||
|
|
Loading…
Reference in New Issue