mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
check if the term is a dict so we can take a simple list of files (like first_available_file) takes
This commit is contained in:
parent
dfad94078b
commit
804b130288
1 changed files with 27 additions and 25 deletions
|
@ -81,6 +81,7 @@ class LookupModule(object):
|
||||||
def run(self, terms, **kwargs):
|
def run(self, terms, **kwargs):
|
||||||
result = None
|
result = None
|
||||||
for term in terms:
|
for term in terms:
|
||||||
|
if isinstance(term, dict):
|
||||||
files = term.get('files', [])
|
files = term.get('files', [])
|
||||||
paths = term.get('paths', [])
|
paths = term.get('paths', [])
|
||||||
|
|
||||||
|
@ -108,7 +109,8 @@ class LookupModule(object):
|
||||||
for fn in filelist:
|
for fn in filelist:
|
||||||
f = path + '/' + fn
|
f = path + '/' + fn
|
||||||
total_search.append(f)
|
total_search.append(f)
|
||||||
|
else:
|
||||||
|
total_search = [term]
|
||||||
|
|
||||||
result = None
|
result = None
|
||||||
for fn in total_search:
|
for fn in total_search:
|
||||||
|
|
Loading…
Reference in a new issue