mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-10 02:09:11 -07:00
parent
5babe2daea
commit
6f6bdf7914
12 changed files with 58 additions and 71 deletions
|
@ -237,15 +237,17 @@ class DataLoader:
|
|||
b_main = b'main%s' % (suffix)
|
||||
b_tasked = b'tasks/%s' % (b_main)
|
||||
|
||||
if b_path.endswith(b'tasks') and os.path.exists(os.path.join(b_path, b_main)) \
|
||||
or os.path.exists(os.path.join(b_upath, b_tasked)) \
|
||||
or os.path.exists(os.path.join(os.path.dirname(b_path), b_tasked)):
|
||||
if (
|
||||
b_path.endswith(b'tasks') and
|
||||
os.path.exists(os.path.join(b_path, b_main)) or
|
||||
os.path.exists(os.path.join(b_upath, b_tasked)) or
|
||||
os.path.exists(os.path.join(os.path.dirname(b_path), b_tasked))
|
||||
):
|
||||
isit = True
|
||||
break
|
||||
|
||||
return isit
|
||||
|
||||
|
||||
def path_dwim_relative(self, path, dirname, source, is_role=False):
|
||||
'''
|
||||
find one file in either a role or playbook dir with or without
|
||||
|
@ -283,7 +285,7 @@ class DataLoader:
|
|||
search.append(self.path_dwim(os.path.join(basedir, 'tasks', source)))
|
||||
|
||||
# try to create absolute path for loader basedir + templates/files/vars + filename
|
||||
search.append(self.path_dwim(os.path.join(dirname,source)))
|
||||
search.append(self.path_dwim(os.path.join(dirname, source)))
|
||||
search.append(self.path_dwim(os.path.join(basedir, source)))
|
||||
|
||||
# try to create absolute path for loader basedir + filename
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue