From d6f4d9b76d6f12cc9eae1614a33ebb9fa6aa1724 Mon Sep 17 00:00:00 2001 From: Veeti Paananen Date: Sun, 4 May 2014 18:22:00 +0300 Subject: [PATCH] Fix error handling on missing dest with unarchive fixes #7107 --- lib/ansible/runner/action_plugins/unarchive.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ansible/runner/action_plugins/unarchive.py b/lib/ansible/runner/action_plugins/unarchive.py index 5e469e7a63..c943cab514 100644 --- a/lib/ansible/runner/action_plugins/unarchive.py +++ b/lib/ansible/runner/action_plugins/unarchive.py @@ -46,15 +46,16 @@ class ActionModule(object): if complex_args: options.update(complex_args) options.update(utils.parse_kv(module_args)) - source = os.path.expanduser(options.get('src', None)) - dest = os.path.expanduser(options.get('dest', None)) + source = options.get('src', None) + dest = options.get('dest', None) copy = utils.boolean(options.get('copy', 'yes')) if source is None or dest is None: result = dict(failed=True, msg="src (or content) and dest are required") return ReturnData(conn=conn, result=result) - source = template.template(self.runner.basedir, source, inject) + dest = os.path.expanduser(dest) + source = template.template(self.runner.basedir, os.path.expanduser(source), inject) if copy: if '_original_file' in inject: source = utils.path_dwim_relative(inject['_original_file'], 'files', source, self.runner.basedir)