mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Various performance streamlining and making the file features usable in all modules without daisy chaining.
This commit is contained in:
@@ -40,7 +40,7 @@ class ActionModule(object):
|
||||
module_name = 'command'
|
||||
module_args += " #USE_SHELL"
|
||||
|
||||
(module_path, is_new_style) = self.runner._copy_module(conn, tmp, module_name, module_args, inject)
|
||||
(module_path, is_new_style, shebang) = self.runner._copy_module(conn, tmp, module_name, module_args, inject)
|
||||
self.runner._low_level_exec_command(conn, "chmod a+rx %s" % module_path, tmp)
|
||||
|
||||
return self.runner._execute_module(conn, tmp, 'async_wrapper', module_args,
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -80,8 +80,9 @@ class ActionModule(object):
|
||||
if self.runner.sudo and self.runner.sudo_user != 'root':
|
||||
self.runner._low_level_exec_command(conn, "chmod a+r %s" % xfered,
|
||||
tmp)
|
||||
# run the copy module, queue the file module
|
||||
|
||||
# run the copy module
|
||||
module_args = "%s src=%s dest=%s" % (module_args, xfered, dest)
|
||||
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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user