From fd409626fa0b1bac5cc1c97e59d7f5b13a5a890f Mon Sep 17 00:00:00 2001
From: Yaguang Tang <yaguang.tang@canonical.com>
Date: Thu, 1 Aug 2013 18:22:55 +0800
Subject: [PATCH] Add timeout parameter in requests

Fix bug #1207260

Change-Id: I0f57a9b27c2da2521adb6aebfe3fa072c6b56808
---
 cinderclient/client.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cinderclient/client.py b/cinderclient/client.py
index 857f80a03..958a9eb00 100644
--- a/cinderclient/client.py
+++ b/cinderclient/client.py
@@ -79,6 +79,7 @@ class HTTPClient(object):
         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
@@ -133,6 +134,8 @@ class HTTPClient(object):
             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,