mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-02 14:40:19 -07:00
remove query/q (#36315)
* remove query/q remove and fixed tests for removed func * paren fix
This commit is contained in:
parent
5d0ed38e3a
commit
b47d2e07e1
3 changed files with 2 additions and 56 deletions
|
@ -604,11 +604,6 @@ class Templar:
|
|||
def _fail_lookup(self, name, *args, **kwargs):
|
||||
raise AnsibleError("The lookup `%s` was found, however lookups were disabled from templating" % name)
|
||||
|
||||
def _query_lookup(self, name, *args, **kwargs):
|
||||
''' wrapper for lookup, force wantlist true'''
|
||||
kwargs['wantlist'] = True
|
||||
return self._lookup(name, *args, **kwargs)
|
||||
|
||||
def _lookup(self, name, *args, **kwargs):
|
||||
instance = self._lookup_loader.get(name.lower(), loader=self._loader, templar=self)
|
||||
|
||||
|
@ -699,10 +694,9 @@ class Templar:
|
|||
return data
|
||||
|
||||
if disable_lookups:
|
||||
t.globals['query'] = t.globals['q'] = t.globals['lookup'] = self._fail_lookup
|
||||
t.globals['lookup'] = self._fail_lookup
|
||||
else:
|
||||
t.globals['lookup'] = self._lookup
|
||||
t.globals['query'] = t.globals['q'] = self._query_lookup
|
||||
|
||||
t.globals['finalize'] = self._finalize
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue