Don't double dwim first_available_file in template

parent 37bdee33
...@@ -56,17 +56,17 @@ class ActionModule(object): ...@@ -56,17 +56,17 @@ class ActionModule(object):
if 'first_available_file' in inject: if 'first_available_file' in inject:
found = False found = False
for fn in self.runner.module_vars.get('first_available_file'): for fn in self.runner.module_vars.get('first_available_file'):
fn = utils.template(self.runner.basedir, fn, inject) fnt = utils.template(self.runner.basedir, fn, inject)
fn = utils.path_dwim(self.runner.basedir, fn) fnd = utils.path_dwim(self.runner.basedir, fnt)
if os.path.exists(fn): if os.path.exists(fnd):
source = fn source = fnt
found = True found = True
break break
if not found: if not found:
result = dict(failed=True, msg="could not find src in first_available_file list") result = dict(failed=True, msg="could not find src in first_available_file list")
return ReturnData(conn=conn, comm_ok=False, result=result) return ReturnData(conn=conn, comm_ok=False, result=result)
else:
source = utils.template(self.runner.basedir, source, inject) source = utils.template(self.runner.basedir, source, inject)
# template the source data locally & transfer # template the source data locally & transfer
try: try:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment