mirror of
https://github.com/ansible/ansible.git
synced 2026-08-04 16:13:32 +02:00
Update lookup to use positional only arg for name to avoid conflicts (#79839)
This commit is contained in:
@@ -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') }}"
|
||||
Reference in New Issue
Block a user