From 8bc5a446f09b7051afd233c7498da26cce9c2d83 Mon Sep 17 00:00:00 2001 From: zwei Date: Wed, 23 Mar 2016 16:35:39 +0800 Subject: [PATCH] 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 --- cinderclient/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cinderclient/client.py b/cinderclient/client.py index e456cfe6d..c83f7bb1c 100644 --- a/cinderclient/client.py +++ b/cinderclient/client.py @@ -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: