From 3a4ee965f5b9eb14349c66d962ac97c3f097d5ed Mon Sep 17 00:00:00 2001 From: "James E. King III" Date: Wed, 7 Nov 2018 15:32:23 -0500 Subject: [PATCH] Improve debug logging of filetree with path being walked and items found (#47884) --- lib/ansible/plugins/lookup/filetree.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/plugins/lookup/filetree.py b/lib/ansible/plugins/lookup/filetree.py index 3ea0cc5f091..003214f70da 100644 --- a/lib/ansible/plugins/lookup/filetree.py +++ b/lib/ansible/plugins/lookup/filetree.py @@ -183,6 +183,7 @@ class LookupModule(LookupBase): term_file = os.path.basename(term) dwimmed_path = self._loader.path_dwim_relative(basedir, 'files', os.path.dirname(term)) path = os.path.join(dwimmed_path, term_file) + display.debug("Walking '{0}'".format(path)) for root, dirs, files in os.walk(path, topdown=True): for entry in dirs + files: relpath = os.path.relpath(os.path.join(root, entry), path) @@ -191,6 +192,7 @@ class LookupModule(LookupBase): if relpath not in [entry['path'] for entry in ret]: props = file_props(path, relpath) if props is not None: + display.debug(" found '{0}'".format(os.path.join(path, relpath))) ret.append(props) return ret