Removing the posixpath in python-glanceclient has broken the old target

Bug #1230032 reported by Yang Yu
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Undecided
Yang Yu

Bug Description

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 urlparse.urljoin(self.endpoint_path, url) is only v1/images/details.

Yang Yu (yuyangbj)
description: updated
description: updated
Revision history for this message
Feilong Wang (flwang) wrote :

It's too bad to introduced this issue. It should be avoided by a unit case.

Changed in python-glanceclient:
assignee: nobody → Fei Long Wang (flwang)
status: New → In Progress
assignee: Fei Long Wang (flwang) → nobody
status: In Progress → Confirmed
Yang Yu (yuyangbj)
Changed in python-glanceclient:
assignee: nobody → Yang Yu (yuyangbj)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/48285

Changed in python-glanceclient:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/48285
Committed: http://github.com/openstack/python-glanceclient/commit/a0715e966dbdeda18f6c80b2ebf1a8997e0fbb0f
Submitter: Jenkins
Branch: master

commit a0715e966dbdeda18f6c80b2ebf1a8997e0fbb0f
Author: Yang Yu <email address hidden>
Date: Wed Sep 25 10:39:36 2013 -0500

    Fix regression bug after removing posixpath in http.py

    After removing posixpath.normpath(url) in http.py, the code has a
    regression bug that the url like 'http://example.com:80/test' can
    not work. The code urlparse.urljoin() can not work as '%s%s' %
    (self.endpoint_path, url).

    Fixes bug #1230032

    Change-Id: Ie7266fc3a067b92dfeed169086b4bf6a87dedbd6

Changed in python-glanceclient:
status: In Progress → Fix Committed
Louis Taylor (kragniz)
Changed in python-glanceclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.