Commit ba929656 by Brian Coca

fix for when invocation data is missing

parent c5c1dc2f
......@@ -69,7 +69,10 @@ class CallbackModule(CallbackBase):
if ignore_errors:
return
sender = '"Ansible: %s" <root>' % host
attach = "%s: %s" % (res._result['invocation']['module_name'], json.dumps(res._result['invocation']['module_args']))
attach = res._task.action
if 'invocation' in res._result:
attach = "%s: %s" % (res._result['invocation']['module_name'], json.dumps(res._result['invocation']['module_args']))
subject = 'Failed: %s' % attach
body = 'The following task failed for host ' + host + ':\n\n%s\n\n' % attach
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment