From 019f775a93ac331b8951d8626f5e75e146008b17 Mon Sep 17 00:00:00 2001 From: Michael DeHaan Date: Sat, 20 Oct 2012 11:11:31 -0400 Subject: [PATCH] DWIM the paths for first_available_file --- lib/ansible/runner/action_plugins/copy.py | 1 + lib/ansible/runner/action_plugins/template.py | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/ansible/runner/action_plugins/copy.py b/lib/ansible/runner/action_plugins/copy.py index 53c0b11325..956946ce24 100644 --- a/lib/ansible/runner/action_plugins/copy.py +++ b/lib/ansible/runner/action_plugins/copy.py @@ -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 diff --git a/lib/ansible/runner/action_plugins/template.py b/lib/ansible/runner/action_plugins/template.py index 446baed3aa..ff4ba90599 100644 --- a/lib/ansible/runner/action_plugins/template.py +++ b/lib/ansible/runner/action_plugins/template.py @@ -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