Commit 57674fa0 by Brian Coca

Allow requesting a list to lookup plugins instead of , delimited string

parent ee08448b
...@@ -89,6 +89,8 @@ def lookup(name, *args, **kwargs): ...@@ -89,6 +89,8 @@ def lookup(name, *args, **kwargs):
instance = utils.plugins.lookup_loader.get(name.lower(), basedir=kwargs.get('basedir',None)) instance = utils.plugins.lookup_loader.get(name.lower(), basedir=kwargs.get('basedir',None))
tvars = kwargs.get('vars', None) tvars = kwargs.get('vars', None)
wantlist = kwargs.pop('wantlist', False)
if instance is not None: if instance is not None:
try: try:
ran = instance.run(*args, inject=tvars, **kwargs) ran = instance.run(*args, inject=tvars, **kwargs)
...@@ -98,7 +100,7 @@ def lookup(name, *args, **kwargs): ...@@ -98,7 +100,7 @@ def lookup(name, *args, **kwargs):
raise errors.AnsibleUndefinedVariable("One or more undefined variables: %s" % str(e)) raise errors.AnsibleUndefinedVariable("One or more undefined variables: %s" % str(e))
except Exception, e: except Exception, e:
raise errors.AnsibleError('Unexpected error in during lookup: %s' % e) raise errors.AnsibleError('Unexpected error in during lookup: %s' % e)
if ran: if ran and not wantlist:
ran = ",".join(ran) ran = ",".join(ran)
return ran return ran
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment