mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Fixes several bugs exposed in #34893 * Fixes relative path handling in copy so that it splits directories and reconstructs the correct file path * Return failed in the proper circumstances
This commit is contained in:
parent
4373b155a5
commit
ca4147f2cc
4 changed files with 332 additions and 4 deletions
|
@ -492,6 +492,10 @@ class ActionModule(ActionBase):
|
|||
if module_return is None:
|
||||
continue
|
||||
|
||||
if module_return.get('failed'):
|
||||
result.update(module_return)
|
||||
return result
|
||||
|
||||
paths = os.path.split(source_rel)
|
||||
dir_path = ''
|
||||
for dir_component in paths:
|
||||
|
@ -517,6 +521,11 @@ class ActionModule(ActionBase):
|
|||
del new_module_args['src']
|
||||
|
||||
module_return = self._execute_module(module_name='file', module_args=new_module_args, task_vars=task_vars)
|
||||
|
||||
if module_return.get('failed'):
|
||||
result.update(module_return)
|
||||
return result
|
||||
|
||||
module_executed = True
|
||||
changed = changed or module_return.get('changed', False)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue