Various performance streamlining and making the file features usable in all modules without daisy chaining.

This commit is contained in:
Michael DeHaan 2012-10-20 22:51:36 -04:00
parent 60b9316ad8
commit cbc12f0dba
12 changed files with 361 additions and 312 deletions

View file

@ -84,14 +84,13 @@ class ActionModule(object):
# run the copy module
module_args = "%s src=%s" % (module_args, tmp_src)
return self.runner._execute_module(conn, tmp, 'copy', module_args, inject=inject).daisychain('file', module_args)
return self.runner._execute_module(conn, tmp, 'copy', module_args, inject=inject)
else:
# no need to transfer the file, already correct md5, but still need to set src so the file module
# does not freak out. It's just the basename of the file.
# no need to transfer the file, already correct md5, but still need to call
# the file module in case we want to change attributes
tmp_src = tmp + os.path.basename(source)
module_args = "%s src=%s" % (module_args, tmp_src)
result = dict(changed=False, md5sum=remote_md5, transferred=False)
return ReturnData(conn=conn, result=result).daisychain('file', module_args)
return self.runner._execute_module(conn, tmp, 'file', module_args, inject=inject)