Wrong href link returned when providing non-existed version in GET version API

Bug #1705663 reported by Zhenyu Zheng on 2017-07-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
High
Zhenyu Zheng

Bug Description

When calling GET version API with a version that not exist, we returned a list of
correct choices, but the href link is incorrect:

root@kevin-dev:~# curl -g -i -X GET http://10.76.150.17/compute/v2.0 -H "OpenStack-API-Version: compute 2.51" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-OpenStack-Nova-API-Version: 2.51" -H "X-Auth-Token:gAAAAABZcbz3PfBntmI6mpGnnh3y1_uLYGYzZ9ivohMH6ZL2OymLyZkSXfZe-m9PUaGcocKgLsIp2iRHRho_nfF4N-T2erbvT7hzwtyhqBzlNqR5L306QbRfx3wsZmS-0ml0CR2KDa4chVu25ipI7zPUWEpm9GrgYe8BZOKKUVvvHkT442JC8To"
HTTP/1.1 300 Multiple Choices
Date: Fri, 21 Jul 2017 09:08:20 GMT
Server: Apache/2.4.18 (Ubuntu)
Content-Length: 473
Content-Type: application/json
Connection: close

{"choices": [{"status": "SUPPORTED", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.compute+json;version=2"}], "id": "v2.0", "links": [{"href": "http://10.76.150.17/compute/v2/compute/v2.0", "rel": "self"}]}, {"status": "CURRENT", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.compute+json;version=2.1"}], "id": "v2.1", "links": [{"href": "http://10.76.150.17/compute/v2.1/compute/v2.0", "rel": "self"}]}]}

Tags: api Edit Tag help
Changed in nova:
assignee: nobody → Zhenyu Zheng (zhengzhenyu)
description: updated
Sean Dague (sdague) on 2017-07-24
Changed in nova:
status: New → Confirmed
importance: Undecided → High
tags: added: api

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

Changed in nova:
status: Confirmed → In Progress
Matt Riedemann (mriedem) wrote :

Is this latent or a regression in Pike?

jichenjc (jichenjc) wrote :

[root@OSPRUI ~] # curl -g -i --cacert "/data/PKIcerts/certs/cacert.pem" -X GET https://9.60.29.98:8774/compute/v2.0 -H "OpenStack-API-Version: compute 2.37" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-OpenStack-Nova-API-Version: 2.37" -H "X-Auth-Token: 28cf476873b14b6088e9c575e9be3afe"
HTTP/1.1 300 Multiple Choices
Content-Length: 465
Content-Type: application/json
Date: Thu, 27 Jul 2017 08:17:30 GMT

{"choices": [{"status": "SUPPORTED", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.compute+json;version=2"}], "id": "v2.0", "links": [{"href": "https://9.60.29.98:8774/v2/compute/v2.0", "rel": "self"}]}, {"status": "CURRENT", "media-types": [{"base": "application/json", "type": "application/vnd.openstack.compute+json;version=2.1"}], "id": "v2.1", "links": [{"href": "https://9.60.29.98:8774/v2.1/compute/v2.0", "rel": "self"}]}]}[root@OSPRUI ~] #

jichenjc (jichenjc) wrote :

looks like this is a older issue as I am using a Newton environ to test

Change abandoned by Stephen Finucane (<email address hidden>) on branch: master
Review: https://review.opendev.org/486850

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers