Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor lookup plugins using top down method (ansible-collections#523)
SUMMARY This change rewrites the lookup plugin logic to use a top down approach to finding objects. The plugins will now step through an objects path and try to lookup each intermediate object until it gets to the final object. The old method has a few issues: The existing plugins use an incorrect search method which yield inconsistent results (as described in ansible-collections#500) They also cannot find resources with the same name, even if the paths given are unique. For example, if /datacenter/vms/my-folder and /datacenter/hosts/my-folder both exist, you can never find either one Items with the same name will cause conflicts, even if those items have slightly different paths. For example: /datacenter/vms/foo and /datacenter/hosts/foo existing at the same time makes it difficult to search for either folder Fixes: ansible-collections#500 ansible-collections#445 ansible-collections#324 ISSUE TYPE Bugfix Pull Request COMPONENT NAME all lookup plugins ADDITIONAL INFORMATION The original top down approach is described in ansible-collections#445. I tried to get that version working but ran into a few issues. Reviewed-by: Danielle Barda Reviewed-by: Ondra Machacek <machacek.ondra@gmail.com> Reviewed-by: mikemorency
- Loading branch information