Fix check mode issues with copy module

Fixes #8639
This commit is contained in:
James Cammarata 2014-08-18 16:02:45 -05:00
parent 542f07128e
commit 379e31883c
3 changed files with 5 additions and 1 deletions

View file

@ -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

View file

@ -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):

View file

@ -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'])