summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Sprygada <privateip@users.noreply.github.com>2016-11-26 22:22:55 -0500
committerPeter Sprygada <psprygada@ansible.com>2016-11-26 22:23:43 -0500
commit4d7760c0b1946f4a04cb5593b6c85bbeef74a9c9 (patch)
treed0c513c7c40dbfdc0ebae2fb907830e571a569e9
parentb9a1b2836a76ad0ee039b92db8fd4f7fbeecf1c0 (diff)
downloadansible-4d7760c0b1946f4a04cb5593b6c85bbeef74a9c9.tar.gz
pass module timeout value to fetch_url in eapi connection (#18633)
This change causes the eapi connection to honor the module timeout value when calling fetch_url (cherry picked from commit eec6980f3e6194c6ed841fc84994f1734d31da74)
-rw-r--r--lib/ansible/module_utils/eos.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/ansible/module_utils/eos.py b/lib/ansible/module_utils/eos.py
index 5a59cef4e6..f0878436a5 100644
--- a/lib/ansible/module_utils/eos.py
+++ b/lib/ansible/module_utils/eos.py
@@ -166,6 +166,7 @@ class Eapi(EosConfigMixin):
self.url_args.params['url_username'] = params['username']
self.url_args.params['url_password'] = params['password']
self.url_args.params['validate_certs'] = params['validate_certs']
+ self.url_args.params['timeout'] = params['timeout']
if params['use_ssl']:
proto = 'https'
@@ -205,10 +206,11 @@ class Eapi(EosConfigMixin):
data = json.dumps(body)
headers = {'Content-Type': 'application/json-rpc'}
+ timeout = self.url_args['timeout']
response, headers = fetch_url(
self.url_args, self.url, data=data, headers=headers,
- method='POST'
+ method='POST', timeout=timeout
)
if headers['status'] != 200: