mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Make more lookup plugins tolerant of new variable system, with a little better 'do what I mean' logic to resolving
what happens if you get a string back as a template result.
This commit is contained in:
@@ -73,9 +73,9 @@ class LookupModule(object):
|
||||
calculating the number of entries in a sequence when a stride is specified.
|
||||
"""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
def __init__(self, basedir, **kwargs):
|
||||
"""absorb any keyword args"""
|
||||
pass
|
||||
self.basedir = basedir
|
||||
|
||||
def reset(self):
|
||||
"""set sensible defaults"""
|
||||
@@ -170,11 +170,10 @@ class LookupModule(object):
|
||||
"problem formatting %r with %r" % self.format
|
||||
)
|
||||
|
||||
def run(self, terms, **kwargs):
|
||||
def run(self, terms, inject=None, **kwargs):
|
||||
results = []
|
||||
|
||||
if isinstance(terms, basestring):
|
||||
terms = [terms]
|
||||
terms = utils.listify_lookup_plugin_terms(terms, self.basedir, inject)
|
||||
|
||||
for term in terms:
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user