Replace expanduser with type path

This patch removes the use of expanduser and replaces it with
type 'path' for the option. This is related to #12263.
This commit is contained in:
Tim Rupp 2017-02-11 16:03:52 -08:00 committed by Brian Coca
parent 8adb108aa9
commit 0fcc6edf2b

View file

@ -289,13 +289,13 @@ def main():
argument_spec = url_argument_spec()
argument_spec.update(
url = dict(required=True),
dest = dict(required=True),
dest = dict(required=True, type='path'),
backup = dict(default=False, type='bool'),
sha256sum = dict(default=''),
checksum = dict(default=''),
timeout = dict(required=False, type='int', default=10),
headers = dict(required=False, default=None),
tmp_dest = dict(required=False, default=''),
tmp_dest = dict(required=False, default='', type='path'),
)
module = AnsibleModule(
@ -305,14 +305,14 @@ def main():
)
url = module.params['url']
dest = os.path.expanduser(module.params['dest'])
dest = module.params['dest']
backup = module.params['backup']
force = module.params['force']
sha256sum = module.params['sha256sum']
checksum = module.params['checksum']
use_proxy = module.params['use_proxy']
timeout = module.params['timeout']
tmp_dest = os.path.expanduser(module.params['tmp_dest'])
tmp_dest = module.params['tmp_dest']
# Parse headers to dict
if module.params['headers']: