mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
better module error handling
* now module errors clearly state msg=MODULE FAILURE * module's stdout and stderr go into module_stdout and module_stderr keys which only appear during parsing failure * invocation module_args are deleted from results provided by action plugin as errors can keep us from overwriting and then disclosing info that was meant to be kept hidden due to no_log * fixed invocation module_args set by basic.py as it was creating different keys as the invocation in action plugin base. * results now merge
This commit is contained in:
parent
010839aedc
commit
957b376f9e
3 changed files with 9 additions and 5 deletions
|
@ -460,9 +460,10 @@ class ActionBase(with_metaclass(ABCMeta, object)):
|
|||
if 'stderr' in res and res['stderr'].startswith(u'Traceback'):
|
||||
data['exception'] = res['stderr']
|
||||
else:
|
||||
data['msg'] = res.get('stdout', u'')
|
||||
data['msg'] = "MODULE FAILURE"
|
||||
data['module_stdout'] = res.get('stdout', u'')
|
||||
if 'stderr' in res:
|
||||
data['msg'] += res['stderr']
|
||||
data['module_stderr'] = res['stderr']
|
||||
|
||||
# pre-split stdout into lines, if stdout is in the data and there
|
||||
# isn't already a stdout_lines value there
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue