1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

have to always run dwim() on the path to get the full absolute path.

Fixes #14944
This commit is contained in:
Toshio Kuratomi 2016-03-25 12:09:30 -07:00
parent dc9cce2c94
commit 0cabd133ba

View file

@ -30,18 +30,17 @@ from ansible import constants as C
class ActionModule(ActionBase):
def _get_absolute_path(self, path):
original_path = path
if self._task._role is not None:
original_path = path
path = self._loader.path_dwim_relative(self._task._role._role_path, 'files', path)
else:
path = self._loader.path_dwim_relative(self._loader.get_basedir(), 'files', path)
if self._task._role is not None:
path = self._loader.path_dwim_relative(self._task._role._role_path, 'files', path)
else:
path = self._loader.path_dwim_relative(self._loader.get_basedir(), 'files', path)
if original_path and original_path[-1] == '/' and path[-1] != '/':
# make sure the dwim'd path ends in a trailing "/"
# if the original path did
path += '/'
if original_path and original_path[-1] == '/' and path[-1] != '/':
# make sure the dwim'd path ends in a trailing "/"
# if the original path did
path += '/'
return path