diff options
author | Brian Coca <bcoca@users.noreply.github.com> | 2021-05-17 11:28:42 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-17 10:28:42 -0500 |
commit | 00d5a1610f37395dd9e6010b9f0dbb26342f3a59 (patch) | |
tree | a10baaeb84f69e8bc5101ced2f9175228421ffa4 /lib | |
parent | 22adad0f1952822f3bccfdae28b0554fbb773583 (diff) | |
download | ansible-00d5a1610f37395dd9e6010b9f0dbb26342f3a59.tar.gz |
Fix pb subs collapse (#74301) (#74376)
* fix subdir parsing for plays
fixes #74283
Co-authored-by: Nikolaos Kakouros <nkak@kth.se>
(cherry picked from commit 6418f368e3d13c404cc2d53a6d5dab68f2809996)
Diffstat (limited to 'lib')
-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 393ddbee7b..b398426583 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 |