Fix wrong request url when retrieving multiple request

When the length of resource list is larger than osapi_max_limit.
Cinder will return a "maker url" which marks index of resources
already returned to client.
_cs_request() function fo HTTPClient will link the endpoint url of cinder
and this "marker url" together then use this wrong linked url to request
the server side, which cause a NotFound exception.

Closes-bug: #1560862
Change-Id: I416b63758373dc8ad29818d6952d1e9dd58d05f2
This commit is contained in:
zwei 2016-03-23 16:35:39 +08:00
parent fb175864f9
commit 8bc5a446f0

@ -291,8 +291,9 @@ class HTTPClient(object):
if self.projectid:
kwargs['headers']['X-Auth-Project-Id'] = self.projectid
try:
resp, body = self.request(self.management_url + url, method,
**kwargs)
if not url.startswith(self.management_url):
url = self.management_url + url
resp, body = self.request(url, method, **kwargs)
return resp, body
except exceptions.BadRequest as e:
if attempts > self.retries: