mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-25 11:51:26 -07:00
Rename original_basename parameter in various file-related modules
original_basename is a private internal parameter so name it _original_basename to reflect that it is internal.
This commit is contained in:
parent
cd4d0069ba
commit
20b9ca6e7c
9 changed files with 45 additions and 58 deletions
|
@ -90,33 +90,19 @@ class ActionModule(ActionBase):
|
|||
# handle diff mode client side
|
||||
# handle check mode client side
|
||||
|
||||
if not remote_src:
|
||||
# fix file permissions when the copy is done as a different user
|
||||
self._fixup_perms2((self._connection._shell.tmpdir, tmp_src))
|
||||
# Build temporary module_args.
|
||||
new_module_args = self._task.args.copy()
|
||||
new_module_args.update(
|
||||
dict(
|
||||
src=tmp_src,
|
||||
original_basename=os.path.basename(source),
|
||||
),
|
||||
)
|
||||
|
||||
else:
|
||||
new_module_args = self._task.args.copy()
|
||||
new_module_args.update(
|
||||
dict(
|
||||
original_basename=os.path.basename(source),
|
||||
),
|
||||
)
|
||||
|
||||
# remove action plugin only key
|
||||
# remove action plugin only keys
|
||||
new_module_args = self._task.args.copy()
|
||||
for key in ('decrypt',):
|
||||
if key in new_module_args:
|
||||
del new_module_args[key]
|
||||
|
||||
# execute the unarchive module now, with the updated args
|
||||
result.update(self._execute_module(module_args=new_module_args, task_vars=task_vars))
|
||||
if not remote_src:
|
||||
# fix file permissions when the copy is done as a different user
|
||||
self._fixup_perms2((self._connection._shell.tmpdir, tmp_src))
|
||||
new_module_args['src'] = tmp_src
|
||||
|
||||
# execute the unarchive module now, with the updated args
|
||||
result.update(self._execute_module(module_args=new_module_args, task_vars=task_vars))
|
||||
except AnsibleAction as e:
|
||||
result.update(e.result)
|
||||
finally:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue