diff options
author | Brian Coca <bcoca@users.noreply.github.com> | 2021-04-21 17:27:41 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-21 17:27:41 -0400 |
commit | 6418f368e3d13c404cc2d53a6d5dab68f2809996 (patch) | |
tree | b74ada1211a4e8649555bb3ab7353f8d686c3f02 /lib/ansible/utils/collection_loader | |
parent | a3e7cf0110c1d2e7faf08e3ea4ac61db7b6f9bcb (diff) | |
download | ansible-6418f368e3d13c404cc2d53a6d5dab68f2809996.tar.gz |
Fix pb subs collapse (#74301)
* fix subdir parsing for plays
fixes #74283
Co-authored-by: Nikolaos Kakouros <nkak@kth.se>
Diffstat (limited to 'lib/ansible/utils/collection_loader')
-rw-r--r-- | lib/ansible/utils/collection_loader/_collection_finder.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ansible/utils/collection_loader/_collection_finder.py b/lib/ansible/utils/collection_loader/_collection_finder.py index f684da2ef0..e0c3c109b9 100644 --- a/lib/ansible/utils/collection_loader/_collection_finder.py +++ b/lib/ansible/utils/collection_loader/_collection_finder.py @@ -891,6 +891,12 @@ def _get_collection_playbook_path(playbook): if pkg: cpath = os.path.join(sys.modules[acr.n_python_collection_package_name].__file__.replace('__synthetic__', 'playbooks')) + + if acr.subdirs: + paths = [to_native(x) for x in acr.subdirs.split(u'.')] + paths.insert(0, cpath) + cpath = os.path.join(*paths) + path = os.path.join(cpath, to_native(acr.resource)) if os.path.exists(to_bytes(path)): return acr.resource, path, acr.collection |