mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix search path for relative paths in roles (fixes #17877)
(cherry picked from commit 72f0aaf606aa3399c0713ad1eaac394c3846813c)
This commit is contained in:
parent
9bdde13126
commit
194c9c41eb
1 changed files with 5 additions and 1 deletions
|
@ -312,6 +312,10 @@ class DataLoader():
|
||||||
if b_mydir.endswith(b'tasks'):
|
if b_mydir.endswith(b'tasks'):
|
||||||
search.append(os.path.join(os.path.dirname(b_mydir), b_dirname, b_source))
|
search.append(os.path.join(os.path.dirname(b_mydir), b_dirname, b_source))
|
||||||
search.append(os.path.join(b_mydir, b_source))
|
search.append(os.path.join(b_mydir, b_source))
|
||||||
|
else:
|
||||||
|
# don't add dirname if user already is using it in source
|
||||||
|
if b_source.split(b'/')[0] == b_dirname:
|
||||||
|
search.append(os.path.join(b_upath, b_source))
|
||||||
else:
|
else:
|
||||||
search.append(os.path.join(b_upath, b_dirname, b_source))
|
search.append(os.path.join(b_upath, b_dirname, b_source))
|
||||||
search.append(os.path.join(b_upath, b'tasks', b_source))
|
search.append(os.path.join(b_upath, b'tasks', b_source))
|
||||||
|
|
Loading…
Reference in a new issue