mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-05 07:54:00 -07:00
Add a base-level get_basedir method for lookup plugins and fix relative lookups
Fixes #11746
This commit is contained in:
parent
3a4dd523d3
commit
ee835ff7ad
5 changed files with 14 additions and 15 deletions
|
@ -26,9 +26,11 @@ class LookupModule(LookupBase):
|
|||
|
||||
def run(self, terms, variables=None, **kwargs):
|
||||
|
||||
basedir = self.get_basedir(variables)
|
||||
|
||||
ret = []
|
||||
for term in terms:
|
||||
dwimmed = self._loader.path_dwim(term)
|
||||
dwimmed = self._loader.path_dwim_relative(basedir, 'files', term)
|
||||
globbed = glob.glob(dwimmed)
|
||||
ret.extend(g for g in globbed if os.path.isfile(g))
|
||||
return ret
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue