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

Allow doing things like "groups.groupname" in with_nested.

Fixes #3858
This commit is contained in:
Michael DeHaan 2013-10-07 16:57:45 -04:00
parent a2ac5d6df2
commit a7adc8ef4d
2 changed files with 4 additions and 10 deletions

View file

@ -45,12 +45,8 @@ class LookupModule(object):
def __lookup_injects(self, terms, inject):
results = []
for x in terms:
if isinstance(x, basestring) and x in inject:
results.append(inject[x])
elif isinstance(x, basestring):
raise errors.AnsibleError("cannot resolve: %s" % x)
else:
results.append(x)
intermediate = utils.listify_lookup_plugin_terms(x, self.basedir, inject)
results.append(intermediate)
return results
def run(self, terms, inject=None, **kwargs):

View file

@ -45,10 +45,8 @@ class LookupModule(object):
def __lookup_injects(self, terms, inject):
results = []
for x in terms:
if isinstance(x, basestring) and x in inject:
results.append(inject[x])
else:
results.append(x)
intermediate = utils.listify_lookup_plugin_terms(x, self.basedir, inject)
results.append(intermediate)
return results
def run(self, terms, inject=None, **kwargs):