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
This commit is contained in:
parent
f8eef18297
commit
ebe02fb877
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user