Update lookup to use positional only arg for name to avoid conflicts (#79839)

pull/80049/head
devon-mar 2 years ago committed by GitHub
parent 122de95d85
commit 2f8f7fba4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,3 @@
---
bugfixes:
- templates - Fixed `TypeError` when a lookup plugin has an option called `name`.

@ -810,12 +810,12 @@ class Templar:
return now
def _query_lookup(self, name, *args, **kwargs):
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):
def _lookup(self, name, /, *args, **kwargs):
instance = lookup_loader.get(name, loader=self._loader, templar=self)
if instance is None:

@ -0,0 +1,2 @@
shippable/posix/group4
context/controller

@ -0,0 +1,6 @@
---
- debug:
msg: "{{ lookup('vars', name='test') }}"
- debug:
msg: "{{ query('vars', name='test') }}"
Loading…
Cancel
Save