yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #43117
[Bug 1489627] Re: Incorrect use of os.path.join() in nova/api/openstack/common.py
Reviewed: https://review.openstack.org/218309
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=7a09f727f3027e4f0d54d99f1579f6595720d094
Submitter: Jenkins
Branch: master
commit 7a09f727f3027e4f0d54d99f1579f6595720d094
Author: EdLeafe <ed@xxxxxxxxx>
Date: Thu Aug 27 21:54:12 2015 +0000
Replace os.path.join() for URLs
Since os.path.join() is OS-dependent, it should not be used for creating
URLs. This patch replaces the use of os.path.join() in
nova/api/openstack with common.url_join(), which uses the more correct
"/".join(), while preserving the behavior of removing duplicate slashes
inside the URL and adding a trailing slash with an empty final element.
It also adds some tests to ensure that the generate_href() method in
nova/api/openstack/compute/views/versions.py works after the refactoring
to use common.url_join()
Closes-Bug: 1489627
Change-Id: I32948dd1fcf0839b34e446d9e4b08f9c39d17c8f
** Changed in: nova
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1489627
Title:
Incorrect use of os.path.join() in nova/api/openstack/common.py
Status in OpenStack Compute (nova):
Fix Released
Bug description:
Three of the link manipulation methods in nova/api/openstack/common.py
rejoin the URL parts by using os.path.join(). This is incorrect, as it
is OS-dependent, and can result in invalid URLs under Windows.
Generally the urlparse module would be the best choice, but since
these URL fragments aren't created with urlparse.urlparse() or
urlparse.urlsplit(), the equivalent reconstruction methods in that
module won't work. It is simpler and cleaner to just use "/".join().
Additionally, there are no unit tests for these methods, so tests will
have to be added first before we can fix the methods, so that we have
some assurance that we are not breaking anything.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1489627/+subscriptions
References