1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Return skipped/failed async results directly

Fixes #13205
This commit is contained in:
James Cammarata 2015-11-19 08:29:15 -05:00
parent 3b16ad973c
commit 78e4f176e6

View file

@ -405,6 +405,8 @@ class TaskExecutor:
# the async_wrapper module returns dumped JSON via its stdout
# response, so we parse it here and replace the result
try:
if 'skipped' in result and result['skipped'] or 'failed' in result and result['failed']:
return result
result = json.loads(result.get('stdout'))
except (TypeError, ValueError) as e:
return dict(failed=True, msg="The async task did not return valid JSON: %s" % str(e))