synchronize: use _find_needle instead

This commit is contained in:
Mohammed Naser 2023-03-21 18:46:25 -04:00 committed by Abhijeet Kasurde
parent 1994b2cf1c
commit 22d50a3903

View file

@ -48,10 +48,7 @@ class ActionModule(ActionBase):
if ':' in path or path.startswith('/'): if ':' in path or path.startswith('/'):
return path return path
if self._task._role is not None: path = self._find_needle('files', 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 original_path and original_path[-1] == '/' and path[-1] != '/': if original_path and original_path[-1] == '/' and path[-1] != '/':
# make sure the dwim'd path ends in a trailing "/" # make sure the dwim'd path ends in a trailing "/"