1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

DWIM the paths for first_available_file

This commit is contained in:
Michael DeHaan 2012-10-20 11:11:31 -04:00
parent 6fa1a49037
commit 019f775a93
2 changed files with 2 additions and 0 deletions

View file

@ -54,6 +54,7 @@ class ActionModule(object):
found = False
for fn in inject.get('first_available_file'):
fn = utils.template(self.runner.basedir, fn, inject)
fn = utils.path_dwim(self.runner.basedir, fn)
if os.path.exists(fn):
source = fn
found = True

View file

@ -57,6 +57,7 @@ class ActionModule(object):
found = False
for fn in self.runner.module_vars.get('first_available_file'):
fn = utils.template(self.runner.basedir, fn, inject)
fn = utils.path_dwim(self.runner.basedir, fn)
if os.path.exists(fn):
source = fn
found = True