uri: deprecate 'yes' or 'no' value in follow_redirects param

* 'yes' or 'no' value deprecated and set to removal in version 2.22

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
pull/83169/head
Abhijeet Kasurde 1 month ago
parent 585ef6c55e
commit 0c4cbe7856

@ -0,0 +1,3 @@
---
bugfixes:
- uri - deprecate 'yes' and 'no' value for 'follow_redirects' parameter.

@ -107,12 +107,14 @@ options:
default: no
follow_redirects:
description:
- Whether or not the URI module should follow redirects. V(all) will follow all redirects.
V(safe) will follow only "safe" redirects, where "safe" means that the client is only
doing a GET or HEAD on the URI to which it is being redirected. V(none) will not follow
any redirects. Note that V(true) and V(false) choices are accepted for backwards compatibility,
where V(true) is the equivalent of V(all) and V(false) is the equivalent of V(safe). V(true) and V(false)
are deprecated and will be removed in some future version of Ansible.
- Whether or not the URI module should follow redirects.
- V(all) will follow all redirects.
- V(safe) will follow only "safe" redirects, where "safe" means that the client is only
doing a GET or HEAD on the URI to which it is being redirected.
- V(none) will not follow any redirects.
- Note that V(true) and V(false) choices are accepted for backwards compatibility,
where V(true) is the equivalent of V(all) and V(false) is the equivalent of V(safe).
V(true) and V(false) are deprecated and will be removed in Ansible 2.22.
type: str
choices: ['all', 'no', 'none', 'safe', 'urllib2', 'yes']
default: safe
@ -580,6 +582,12 @@ def uri(module, url, dest, body, body_format, method, headers, socket_timeout, c
# if destination file already exist, only download if file newer
kwargs['last_mod_time'] = utcfromtimestamp(os.path.getmtime(dest))
if module.params.get('follow_redirects') in ('no', 'yes'):
module.deprecate(
"Using 'yes' or 'no' for 'follow_redirects' parameter is deprecated.",
version='2.22'
)
resp, info = fetch_url(module, url, data=data, headers=headers,
method=method, timeout=socket_timeout, unix_socket=module.params['unix_socket'],
ca_path=ca_path, unredirected_headers=unredirected_headers,

Loading…
Cancel
Save