mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 04:40:22 -07:00
stop passing loader/dataloader since it has been deprecated by ansible (#6074)
* stop passing loader/dataloader since it has been deprecated by ansible Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com> * add changelog fragment Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com> * explicitly pass None to keep compatibility to older Ansible versions Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com> * use try/except to keep things compatible Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com> * Update plugins/lookup/cartesian.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/flattened.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/flattened.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/lookup/cartesian.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update changelogs/fragments/6074-loader_in_listify.yml.yml Co-authored-by: Felix Fontein <felix@fontein.de> --------- Signed-off-by: Martin Schurz <Martin.Schurz@t-systems.com> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
7d3e6d1bb7
commit
b64929118e
3 changed files with 14 additions and 2 deletions
|
@ -66,7 +66,12 @@ class LookupModule(LookupBase):
|
|||
"""
|
||||
results = []
|
||||
for x in terms:
|
||||
intermediate = listify_lookup_plugin_terms(x, templar=self._templar, loader=self._loader)
|
||||
try:
|
||||
intermediate = listify_lookup_plugin_terms(x, templar=self._templar)
|
||||
except TypeError:
|
||||
# The loader argument is deprecated in ansible-core 2.14+. Fall back to
|
||||
# pre-2.14 behavior for older ansible-core versions.
|
||||
intermediate = listify_lookup_plugin_terms(x, templar=self._templar, loader=self._loader)
|
||||
results.append(intermediate)
|
||||
return results
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue