From bb8666471dc7392b9f9ea00a0f09b73e514c525b Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 1 May 2017 20:27:37 +0530 Subject: [PATCH] Update documentation of fetch_url in urls.py (#23892) Signed-off-by: Abhijeet Kasurde --- lib/ansible/module_utils/urls.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ansible/module_utils/urls.py b/lib/ansible/module_utils/urls.py index 0aa750e6ba..b7ff6076f1 100644 --- a/lib/ansible/module_utils/urls.py +++ b/lib/ansible/module_utils/urls.py @@ -992,7 +992,7 @@ def url_argument_spec(): def fetch_url(module, url, data=None, headers=None, method=None, use_proxy=True, force=False, last_mod_time=None, timeout=10): - '''Sends a request via HTTP(S) or FTP (needs the module as parameter) + """Sends a request via HTTP(S) or FTP (needs the module as parameter) :arg module: The AnsibleModule (used to get username, password etc. (s.b.). :arg url: The url to use. @@ -1012,7 +1012,8 @@ def fetch_url(module, url, data=None, headers=None, method=None, Example:: data={...} - resp, info = fetch_url("http://example.com", + resp, info = fetch_url(module, + "http://example.com", data=module.jsonify(data) header={Content-type': 'application/json'}, method="POST") @@ -1020,7 +1021,7 @@ def fetch_url(module, url, data=None, headers=None, method=None, body = resp.read() if status_code >= 400 : body = info['body'] -''' + """ if not HAS_URLPARSE: module.fail_json(msg='urlparse is not installed')