mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
'changed' key is not defined when task fails
fix KeyError introduced by fix of #6591.
This commit is contained in:
parent
7a53862046
commit
c76501b8a3
1 changed files with 1 additions and 1 deletions
|
@ -123,7 +123,7 @@ class ActionModule(object):
|
||||||
return ReturnData(conn=conn, comm_ok=True, result=dict(changed=True), diff=dict(before_header=dest, after_header=source, before=dest_contents, after=resultant))
|
return ReturnData(conn=conn, comm_ok=True, result=dict(changed=True), diff=dict(before_header=dest, after_header=source, before=dest_contents, after=resultant))
|
||||||
else:
|
else:
|
||||||
res = self.runner._execute_module(conn, tmp, 'copy', module_args, inject=inject, complex_args=complex_args)
|
res = self.runner._execute_module(conn, tmp, 'copy', module_args, inject=inject, complex_args=complex_args)
|
||||||
if res.result['changed']:
|
if res.result.get('changed', False):
|
||||||
res.diff = dict(before=dest_contents, after=resultant)
|
res.diff = dict(before=dest_contents, after=resultant)
|
||||||
return res
|
return res
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue