Commit 379e3188 by James Cammarata

Fix check mode issues with copy module

Fixes #8639
parent 542f0712
...@@ -243,7 +243,8 @@ class ActionModule(object): ...@@ -243,7 +243,8 @@ class ActionModule(object):
dest=dest, dest=dest,
original_basename=source_rel original_basename=source_rel
) )
if self.runner.noop_on_check(inject):
new_module_args['CHECKMODE'] = True
if self.runner.no_log: if self.runner.no_log:
new_module_args['NO_LOG'] = True new_module_args['NO_LOG'] = True
......
...@@ -484,6 +484,8 @@ def merge_module_args(current_args, new_args): ...@@ -484,6 +484,8 @@ def merge_module_args(current_args, new_args):
for (k,v) in final_args.iteritems(): for (k,v) in final_args.iteritems():
if isinstance(v, basestring): if isinstance(v, basestring):
module_args = "%s=%s %s" % (k, pipes.quote(v), module_args) module_args = "%s=%s %s" % (k, pipes.quote(v), module_args)
elif isinstance(v, bool):
module_args = "%s=%s %s" % (k, str(v), module_args)
return module_args.strip() return module_args.strip()
def parse_yaml(data, path_hint=None): def parse_yaml(data, path_hint=None):
......
...@@ -145,6 +145,7 @@ def main(): ...@@ -145,6 +145,7 @@ def main():
directory_mode = dict(required=False) directory_mode = dict(required=False)
), ),
add_file_common_args=True, add_file_common_args=True,
supports_check_mode=True,
) )
src = os.path.expanduser(module.params['src']) src = os.path.expanduser(module.params['src'])
......
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