From 3c39bb5633d0cbfa9cf22f9a4038296caef9c622 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 13 Jul 2016 10:06:34 -0400 Subject: fixed lookup search path (#16630) * fixed lookup search path added ansible_search_path var that contains the proper list and in order removed roledir var which was only used by first_found, rest used role_path added needle function for lookups that mirrors the action plugin one, now both types of plugins use same pathing. * added missing os import * renamed as per feedback * fixed missing rename in first_found * also fixed first_found * fixed import to match new error class * fixed getattr ref --- lib/ansible/plugins/lookup/fileglob.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lib/ansible/plugins/lookup/fileglob.py') diff --git a/lib/ansible/plugins/lookup/fileglob.py b/lib/ansible/plugins/lookup/fileglob.py index 7889e6e5bc..2f4ece02da 100644 --- a/lib/ansible/plugins/lookup/fileglob.py +++ b/lib/ansible/plugins/lookup/fileglob.py @@ -26,12 +26,10 @@ class LookupModule(LookupBase): def run(self, terms, variables=None, **kwargs): - basedir = self.get_basedir(variables) - ret = [] for term in terms: term_file = os.path.basename(term) - dwimmed_path = self._loader.path_dwim_relative(basedir, 'files', os.path.dirname(term)) + dwimmed_path = self.find_file_in_search_path(variables, 'files', os.path.dirname(term)) globbed = glob.glob(os.path.join(dwimmed_path, term_file)) ret.extend(g for g in globbed if os.path.isfile(g)) return ret -- cgit v1.2.1