Warn when using the deprecated HEADER_ arguments (#20236)

* Make sure the uri module warns about using the deprecated HEADER_ arguments, so that we can actually deprecate in a future version

* Use module.deprecate

* No need to de-dupe ourselves, looks like it is done somewhere I didn't initially see
This commit is contained in:
Matt Martz 2017-03-01 10:35:48 -06:00 committed by Brian Coca
parent 6ea4e9f17f
commit 6e8e90ceb4
2 changed files with 5 additions and 1 deletions

View file

@ -413,6 +413,9 @@ def main():
# currently a bit ugly. (e.g. headers='{"Content-Type":"application/json"}')
for key, value in six.iteritems(module.params):
if key.startswith("HEADER_"):
module.deprecate('Supplying headers via HEADER_* is deprecated and '
'will be removed in a future version. Please use '
'`headers` to supply headers for the request')
skey = key.replace("HEADER_", "")
dict_headers[skey] = value

View file

@ -180,7 +180,8 @@
url: 'http://{{ httpbin_host }}/digest-auth/auth/user/passwd'
user: user
password: passwd
HEADER_Cookie: "fake=fake_value"
headers:
Cookie: "fake=fake_value"
- name: test PUT
uri: