Skip to content

Commit 941c70b

Browse files
committed
Merge pull request #3 from DataDog/olivielpeau/fix-runner-on-ok-key-error
Fix KeyError on `res` argument passed to `runner_on_ok`
2 parents 3f942d2 + 9ba597a commit 941c70b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

datadog_callback.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def runner_on_failed(self, host, res, ignore_errors=False):
124124

125125
def runner_on_ok(self, host, res):
126126
# Only send an event when the task has changed on the host
127-
if res['changed']:
127+
if res.get('changed'):
128128
event_text = "$$$\n{0}[{1}]\n$$$\n".format(res['invocation']['module_name'], res['invocation']['module_args'])
129129
self.send_task_event(
130130
'Ansible task changed on "{0}"'.format(host),

0 commit comments

Comments
 (0)