1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Re-implement lookup wantlist

Fixes #13285
This commit is contained in:
James Cammarata 2015-11-29 23:45:14 -05:00
parent dfa576b037
commit f926e81782

View file

@ -391,6 +391,8 @@ class Templar:
instance = self._lookup_loader.get(name.lower(), loader=self._loader, templar=self)
if instance is not None:
wantlist = kwargs.pop('wantlist', False)
from ansible.utils.listify import listify_lookup_plugin_terms
loop_terms = listify_lookup_plugin_terms(terms=args, templar=self, loader=self._loader, fail_on_undefined=True, convert_bare=False)
# safely catch run failures per #5059
@ -404,7 +406,10 @@ class Templar:
ran = None
if ran:
from ansible.vars.unsafe_proxy import UnsafeProxy
from ansible.vars.unsafe_proxy import UnsafeProxy, wrap_var
if wantlist:
ran = wrap_var(ran)
else:
ran = UnsafeProxy(",".join(ran))
return ran