Comment 0 for bug 1230032

Revision history for this message
Yang Yu (yuyangbj) wrote :

There is a bug below reported in python-glanceclient to remove the posixpath, but the fix has brought a new regression bug.

https://bugs.launchpad.net/python-glanceclient/+bug/1208618

The code has been changed from

-------------------------------------------
if self.endpoint_path:
                url = '%s/%s' % (self.endpoint_path, url)
            conn_url = posixpath.normpath(url)
----------------------------------------------------
to
-------------------------------------------------------------
             if self.endpoint_path:
                url = urlparse.urljoin(self.endpoint_path, url)
            conn_url = urlparse.urlsplit(url).geturl()

Actually, the urlparse.urljoin() can not work as the code '%s/%s' % (self.endpoint_path, url), for example, when the self.endpoint_path is '/87823490349243', the url is '/v1/images/details', the output is different for these two line codes.

output for '%s/%s' % (self.endpoint_path, url) is /87823490349243/v1/images/details, but output for url = '%s/%s' % (self.endpoint_path, url) is only v1/images/details.