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

Fix error handling on missing dest with unarchive

fixes #7107
This commit is contained in:
Veeti Paananen 2014-05-04 18:22:00 +03:00
parent 9b52ce8a42
commit d6f4d9b76d

View file

@ -46,15 +46,16 @@ class ActionModule(object):
if complex_args: if complex_args:
options.update(complex_args) options.update(complex_args)
options.update(utils.parse_kv(module_args)) options.update(utils.parse_kv(module_args))
source = os.path.expanduser(options.get('src', None)) source = options.get('src', None)
dest = os.path.expanduser(options.get('dest', None)) dest = options.get('dest', None)
copy = utils.boolean(options.get('copy', 'yes')) copy = utils.boolean(options.get('copy', 'yes'))
if source is None or dest is None: if source is None or dest is None:
result = dict(failed=True, msg="src (or content) and dest are required") result = dict(failed=True, msg="src (or content) and dest are required")
return ReturnData(conn=conn, result=result) 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 copy:
if '_original_file' in inject: if '_original_file' in inject:
source = utils.path_dwim_relative(inject['_original_file'], 'files', source, self.runner.basedir) source = utils.path_dwim_relative(inject['_original_file'], 'files', source, self.runner.basedir)