Skip to content

Commit

Permalink
Add timeout parameter in requests
Browse files Browse the repository at this point in the history
Fix bug #1207260

Change-Id: I0f57a9b27c2da2521adb6aebfe3fa072c6b56808
  • Loading branch information
Yaguang Tang committed Aug 1, 2013
1 parent 53a0344 commit fd40962
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cinderclient/client.py
Expand Up @@ -79,6 +79,7 @@ def __init__(self, user, password, projectid, auth_url, insecure=False,
self.auth_token = None
self.proxy_token = proxy_token
self.proxy_tenant_id = proxy_tenant_id
self.timeout = timeout

if insecure:
self.verify_cert = False
Expand Down Expand Up @@ -133,6 +134,8 @@ def request(self, url, method, **kwargs):
kwargs['data'] = json.dumps(kwargs['body'])
del kwargs['body']

if self.timeout:
kwargs.setdefault('timeout', self.timeout)
self.http_log_req((url, method,), kwargs)
resp = requests.request(
method,
Expand Down

0 comments on commit fd40962

Please sign in to comment.