Handle debug tasks more robust in zuul_stream
We currently rely on detecting debug tasks by checking if there is only a single variable other than variables starting with '_ansible'. This doesn't work anymore with ansible 2.4. Detecting them by the action should work better and more reliably. Further also strip the 'changed' variable in this case as this has no meaning for a debug task. Change-Id: I562329ce68c279965afc32ba5fda6615423de43a
This commit is contained in:
parent
bdcd29b8fe
commit
36924466e9
|
@ -367,12 +367,13 @@ class CallbackModule(default.CallbackModule):
|
||||||
self._log_message(
|
self._log_message(
|
||||||
result, status='MODULE FAILURE',
|
result, status='MODULE FAILURE',
|
||||||
msg=result_dict['module_stderr'])
|
msg=result_dict['module_stderr'])
|
||||||
elif (len([key for key in result_dict.keys()
|
elif result._task.action == 'debug':
|
||||||
if not key.startswith('_ansible')]) == 1):
|
|
||||||
# this is a debug statement, handle it special
|
# this is a debug statement, handle it special
|
||||||
for key in [k for k in result_dict.keys()
|
for key in [k for k in result_dict.keys()
|
||||||
if k.startswith('_ansible')]:
|
if k.startswith('_ansible')]:
|
||||||
del result_dict[key]
|
del result_dict[key]
|
||||||
|
if 'changed' in result_dict.keys():
|
||||||
|
del result_dict['changed']
|
||||||
keyname = next(iter(result_dict.keys()))
|
keyname = next(iter(result_dict.keys()))
|
||||||
# If it has msg, that means it was like:
|
# If it has msg, that means it was like:
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue