summaryrefslogtreecommitdiff
path: root/cinderclient/exceptions.py
diff options
context:
space:
mode:
authorJavier Pena <jpena@redhat.com>2016-07-06 16:06:28 +0200
committerJavier Pena <jpena@redhat.com>2016-07-06 18:42:30 +0200
commitebe02fb877a09d25d9dbb198934fd74eb0a455d6 (patch)
tree84d012b633bd09509c1af94aa77706fd6849e683 /cinderclient/exceptions.py
parentf8eef18297ec2dba4abf45f8ca57c40c2380cad9 (diff)
downloadpython-cinderclient-ebe02fb877a09d25d9dbb198934fd74eb0a455d6.tar.gz
Fix _get_rate_limit when resp is None
https://review.openstack.org/332848 added retry logic for the client. Function _get_rate_limit may receive resp=None (seen in the Sahara unit tests), and in that case we get an exception. Change-Id: Ibfbb10087121bae7d6f4abdd4cdb8d04d039c970
Diffstat (limited to 'cinderclient/exceptions.py')
-rw-r--r--cinderclient/exceptions.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cinderclient/exceptions.py b/cinderclient/exceptions.py
index 03a50e7..72366c3 100644
--- a/cinderclient/exceptions.py
+++ b/cinderclient/exceptions.py
@@ -160,7 +160,7 @@ class OverLimit(ClientException):
self._get_rate_limit(response)
def _get_rate_limit(self, resp):
- if resp.headers:
+ if (resp is not None) and resp.headers:
utc_now = timeutils.utcnow()
value = resp.headers.get('Retry-After', '0')
try: