mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 22:33:25 +00:00
dest_contents isn’t always defined, so don’t pass it around
I think this is also a bit of a hack since it should probably be set before being used, I’m just not sure what it should be set to.
This commit is contained in:
@@ -90,10 +90,10 @@ class ActionModule(object):
|
|||||||
module_args = "%s src=%s dest=%s original_basename=%s" % (module_args, pipes.quote(xfered), pipes.quote(dest), pipes.quote(os.path.basename(src)))
|
module_args = "%s src=%s dest=%s original_basename=%s" % (module_args, pipes.quote(xfered), pipes.quote(dest), pipes.quote(os.path.basename(src)))
|
||||||
|
|
||||||
if self.runner.noop_on_check(inject):
|
if self.runner.noop_on_check(inject):
|
||||||
return ReturnData(conn=conn, comm_ok=True, result=dict(changed=True), diff=dict(before_header=dest, after_header=src, before=dest_contents, after=resultant))
|
return ReturnData(conn=conn, comm_ok=True, result=dict(changed=True), diff=dict(before_header=dest, after_header=src, after=resultant))
|
||||||
else:
|
else:
|
||||||
res.diff = dict(before=dest_contents, after=resultant)
|
|
||||||
res = self.runner._execute_module(conn, tmp, 'copy', module_args, inject=inject)
|
res = self.runner._execute_module(conn, tmp, 'copy', module_args, inject=inject)
|
||||||
|
res.diff = dict(after=resultant)
|
||||||
return res
|
return res
|
||||||
else:
|
else:
|
||||||
module_args = "%s src=%s dest=%s original_basename=%s" % (module_args, pipes.quote(xfered), pipes.quote(dest), pipes.quote(os.path.basename(src)))
|
module_args = "%s src=%s dest=%s original_basename=%s" % (module_args, pipes.quote(xfered), pipes.quote(dest), pipes.quote(os.path.basename(src)))
|
||||||
|
|||||||
Reference in New Issue
Block a user