mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 22:11:44 -07:00
Fixing several bugs in assemble and updating tests
Bugfixes: * the remote_src param was not being converted to a boolean correctly, resulting in it never being used by the module as the default behavior was remote_src=True (issue #5581) * the remote_src param was not listed in the generic file params, leading to a failure when the above bug regarding remote_src was fixed * the delimiter should always end with a newline to ensure that the file fragments do not run together on one line Fixes #5581
This commit is contained in:
parent
f03d6a67c8
commit
3b2d409906
4 changed files with 10 additions and 3 deletions
|
@ -57,7 +57,7 @@ class ActionModule(object):
|
|||
src = options.get('src', None)
|
||||
dest = options.get('dest', None)
|
||||
delimiter = options.get('delimiter', None)
|
||||
remote_src = options.get('remote_src', True)
|
||||
remote_src = utils.boolean(options.get('remote_src', 'yes'))
|
||||
|
||||
if src is None or dest is None:
|
||||
result = dict(failed=True, msg="src and dest are required")
|
||||
|
@ -65,6 +65,8 @@ class ActionModule(object):
|
|||
|
||||
if remote_src:
|
||||
return self.runner._execute_module(conn, tmp, 'assemble', module_args, inject=inject, complex_args=complex_args)
|
||||
elif '_original_file' in inject:
|
||||
src = utils.path_dwim_relative(inject['_original_file'], 'files', src, self.runner.basedir)
|
||||
|
||||
# Does all work assembling the file
|
||||
path = self._assemble_from_fragments(src, delimiter)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue