← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1489627] [NEW] Incorrect use of os.path.join() in nova/api/openstack/common.py

 

Public bug reported:

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.

** Affects: nova
     Importance: Undecided
     Assignee: Ed Leafe (ed-leafe)
         Status: New

** Changed in: nova
     Assignee: (unassigned) => Ed Leafe (ed-leafe)

-- 
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):
  New

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


Follow ups