yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #26262
[Bug 1343080] Re: alternate link type in GET /images incorrectly includes the project/tenant in the URI
** Changed in: nova
Status: Fix Committed => Fix Released
** Changed in: nova
Milestone: None => kilo-1
--
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/1343080
Title:
alternate link type in GET /images incorrectly includes the
project/tenant in the URI
Status in OpenStack Compute (Nova):
Fix Released
Bug description:
Clearly nobody really uses the "application/vnd.openstack.image" links
in the returned results from GET /v2/{tenant}/images REST API call,
since the link URI returned in it is wrong.
Glance URIs do *not* contain a project or tenant in the URI structure
like Nova's REST API URIs do, but _get_alternate_link() method of the
image ViewBuilder tacks it on improperly:
def _get_alternate_link(self, request, identifier):
"""Create an alternate link for a specific image id."""
glance_url = glance.generate_glance_url()
glance_url = self._update_glance_link_prefix(glance_url)
return '/'.join([glance_url,
request.environ["nova.context"].project_id,
self._collection_name,
str(identifier)])
It's my suspicion that nobody actually uses these alternate links
anyway, but the fix is simple: just remove the
request.environ['nova.context'].project_id in the URL join above.
Note that, yet again, the image service stubs and fakes in the API
unit testing masked this problem. In cleaning up the unit tests to get
rid of the stubbed out image service code, I uncovered this.
To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1343080/+subscriptions
References