← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1486447] [NEW] Removing version of API for bookmark URL is wrong

 

Public bug reported:

Removing version of API for bookmark URL is wrong

Function remove_version_from_href() receives SCRIPT_NAME.
SCRIPT_NAME consists of concatenation of Apache(or other web server) alias and URL mapping from api-paste.conf. This concatenation is executed in https://github.com/openstack/nova/blob/master/nova/api/openstack/urlmap.py#L179 .
As result we can have different URL prefixes but the last part of SCRIPT_NAME is always version of API.

Right now this function is designed to accept URL where API version is not the latest part but the first part of URL. I looked into history and saw that several years ago the logic of function remove_version_from_href() was the same: function expected version of API in the latest part of URL(git show 495137fb):
    def remove_version_from_href(base_url):
        return base_url.rsplit('/', 1).pop(0)
But later this code was refactored many times...

** Affects: nova
     Importance: Undecided
     Assignee: Marian Horban (mhorban)
         Status: New

-- 
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/1486447

Title:
  Removing version of API for bookmark URL is wrong

Status in OpenStack Compute (nova):
  New

Bug description:
  Removing version of API for bookmark URL is wrong

  Function remove_version_from_href() receives SCRIPT_NAME.
  SCRIPT_NAME consists of concatenation of Apache(or other web server) alias and URL mapping from api-paste.conf. This concatenation is executed in https://github.com/openstack/nova/blob/master/nova/api/openstack/urlmap.py#L179 .
  As result we can have different URL prefixes but the last part of SCRIPT_NAME is always version of API.

  Right now this function is designed to accept URL where API version is not the latest part but the first part of URL. I looked into history and saw that several years ago the logic of function remove_version_from_href() was the same: function expected version of API in the latest part of URL(git show 495137fb):
      def remove_version_from_href(base_url):
          return base_url.rsplit('/', 1).pop(0)
  But later this code was refactored many times...

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1486447/+subscriptions


Follow ups