Fix broken version responses

The version responses link to non-existing PDF and WADL files.
Remove the WADL link and replace the PDF link with a HTML link to
docs.openstack.org.

Change-Id: I200e0fa268c4357403ca6c158fbbe682080c13d1
Closes-Bug: #1313119
This commit is contained in:
Andreas Jaeger 2014-04-29 21:30:14 +02:00
parent 2acd7fbe85
commit 3903090a60
3 changed files with 27 additions and 91 deletions

View File

@ -27,16 +27,10 @@ CONF.import_opt('enabled', 'nova.api.openstack', group='osapi_v3')
LINKS = { LINKS = {
'v2.0': { 'v2.0': {
'pdf': 'http://docs.openstack.org/' 'html': 'http://docs.openstack.org/'
'api/openstack-compute/2/os-compute-devguide-2.pdf',
'wadl': 'http://docs.openstack.org/'
'api/openstack-compute/2/wadl/os-compute-2.wadl'
}, },
'v3.0': { 'v3.0': {
'pdf': 'http://docs.openstack.org/' 'html': 'http://docs.openstack.org/'
'api/openstack-compute/3/os-compute-devguide-3.pdf',
'wadl': 'http://docs.openstack.org/'
'api/openstack-compute/3/wadl/os-compute-3.wadl'
}, },
} }
@ -49,13 +43,8 @@ VERSIONS = {
"links": [ "links": [
{ {
"rel": "describedby", "rel": "describedby",
"type": "application/pdf", "type": "text/html",
"href": LINKS['v2.0']['pdf'], "href": LINKS['v2.0']['html'],
},
{
"rel": "describedby",
"type": "application/vnd.sun.wadl+xml",
"href": LINKS['v2.0']['wadl'],
}, },
], ],
"media-types": [ "media-types": [
@ -76,13 +65,8 @@ VERSIONS = {
"links": [ "links": [
{ {
"rel": "describedby", "rel": "describedby",
"type": "application/pdf", "type": "text/html",
"href": LINKS['v3.0']['pdf'], "href": LINKS['v3.0']['html'],
},
{
"rel": "describedby",
"type": "application/vnd.sun.wadl+xml",
"href": LINKS['v3.0']['wadl'],
}, },
], ],
"media-types": [ "media-types": [

View File

@ -28,16 +28,10 @@ NS = {
EXP_LINKS = { EXP_LINKS = {
'v2.0': { 'v2.0': {
'pdf': 'http://docs.openstack.org/' 'html': 'http://docs.openstack.org/'
'api/openstack-compute/2/os-compute-devguide-2.pdf',
'wadl': 'http://docs.openstack.org/'
'api/openstack-compute/2/wadl/os-compute-2.wadl'
}, },
'v3.0': { 'v3.0': {
'pdf': 'http://docs.openstack.org/' 'html': 'http://docs.openstack.org/'
'api/openstack-compute/3/os-compute-devguide-3.pdf',
'wadl': 'http://docs.openstack.org/'
'api/openstack-compute/3/wadl/os-compute-3.wadl'
}, },
} }
@ -54,13 +48,8 @@ EXP_VERSIONS = {
}, },
{ {
"rel": "describedby", "rel": "describedby",
"type": "application/pdf", "type": "text/html",
"href": EXP_LINKS['v2.0']['pdf'], "href": EXP_LINKS['v2.0']['html'],
},
{
"rel": "describedby",
"type": "application/vnd.sun.wadl+xml",
"href": EXP_LINKS['v2.0']['wadl'],
}, },
], ],
"media-types": [ "media-types": [
@ -85,13 +74,8 @@ EXP_VERSIONS = {
}, },
{ {
"rel": "describedby", "rel": "describedby",
"type": "application/pdf", "type": "text/html",
"href": EXP_LINKS['v3.0']['pdf'], "href": EXP_LINKS['v3.0']['html'],
},
{
"rel": "describedby",
"type": "application/vnd.sun.wadl+xml",
"href": EXP_LINKS['v3.0']['wadl'],
}, },
], ],
"media-types": [ "media-types": [

View File

@ -37,10 +37,7 @@ NS = {
EXP_LINKS = { EXP_LINKS = {
'v2.0': { 'v2.0': {
'pdf': 'http://docs.openstack.org/' 'html': 'http://docs.openstack.org/',
'api/openstack-compute/2/os-compute-devguide-2.pdf',
'wadl': 'http://docs.openstack.org/'
'api/openstack-compute/2/wadl/os-compute-2.wadl',
}, },
} }
@ -53,13 +50,8 @@ EXP_VERSIONS = {
"links": [ "links": [
{ {
"rel": "describedby", "rel": "describedby",
"type": "application/pdf", "type": "text/html",
"href": EXP_LINKS['v2.0']['pdf'], "href": EXP_LINKS['v2.0']['html'],
},
{
"rel": "describedby",
"type": "application/vnd.sun.wadl+xml",
"href": EXP_LINKS['v2.0']['wadl'],
}, },
], ],
"media-types": [ "media-types": [
@ -147,13 +139,8 @@ class VersionsTest(test.NoDBTestCase):
}, },
{ {
"rel": "describedby", "rel": "describedby",
"type": "application/pdf", "type": "text/html",
"href": EXP_LINKS['v2.0']['pdf'], "href": EXP_LINKS['v2.0']['html'],
},
{
"rel": "describedby",
"type": "application/vnd.sun.wadl+xml",
"href": EXP_LINKS['v2.0']['wadl'],
}, },
], ],
"media-types": [ "media-types": [
@ -191,13 +178,8 @@ class VersionsTest(test.NoDBTestCase):
}, },
{ {
"rel": "describedby", "rel": "describedby",
"type": "application/pdf", "type": "text/html",
"href": EXP_LINKS['v2.0']['pdf'], "href": EXP_LINKS['v2.0']['html'],
},
{
"rel": "describedby",
"type": "application/vnd.sun.wadl+xml",
"href": EXP_LINKS['v2.0']['wadl'],
}, },
], ],
"media-types": [ "media-types": [
@ -289,16 +271,12 @@ class VersionsTest(test.NoDBTestCase):
self.assertEqual(len(entry.content), 1) self.assertEqual(len(entry.content), 1)
self.assertEqual(entry.content[0].value, self.assertEqual(entry.content[0].value,
'Version v2.0 CURRENT (2011-01-21T11:33:21Z)') 'Version v2.0 CURRENT (2011-01-21T11:33:21Z)')
self.assertEqual(len(entry.links), 3) self.assertEqual(len(entry.links), 2)
self.assertEqual(entry.links[0]['href'], 'http://localhost/v2/') self.assertEqual(entry.links[0]['href'], 'http://localhost/v2/')
self.assertEqual(entry.links[0]['rel'], 'self') self.assertEqual(entry.links[0]['rel'], 'self')
self.assertEqual(entry.links[1], { self.assertEqual(entry.links[1], {
'href': EXP_LINKS['v2.0']['pdf'], 'href': EXP_LINKS['v2.0']['html'],
'type': 'application/pdf', 'type': 'text/html',
'rel': 'describedby'})
self.assertEqual(entry.links[2], {
'href': EXP_LINKS['v2.0']['wadl'],
'type': 'application/vnd.sun.wadl+xml',
'rel': 'describedby'}) 'rel': 'describedby'})
def test_get_version_list_atom(self): def test_get_version_list_atom(self):
@ -696,13 +674,8 @@ class VersionsSerializerTests(test.NoDBTestCase):
}, },
{ {
"rel": "describedby", "rel": "describedby",
"type": "application/pdf", "type": "text/html",
"href": EXP_LINKS['v2.0']['pdf'], "href": EXP_LINKS['v2.0']['html'],
},
{
"rel": "describedby",
"type": "application/vnd.sun.wadl+xml",
"href": EXP_LINKS['v2.0']['wadl'],
}, },
], ],
"media-types": [ "media-types": [
@ -741,15 +714,10 @@ class VersionsSerializerTests(test.NoDBTestCase):
self.assertEqual(len(entry.content), 1) self.assertEqual(len(entry.content), 1)
self.assertEqual(entry.content[0].value, self.assertEqual(entry.content[0].value,
'Version v2.0 CURRENT (2011-01-21T11:33:21Z)') 'Version v2.0 CURRENT (2011-01-21T11:33:21Z)')
self.assertEqual(len(entry.links), 3) self.assertEqual(len(entry.links), 2)
self.assertEqual(entry.links[0]['href'], 'http://localhost/v2/') self.assertEqual(entry.links[0]['href'], 'http://localhost/v2/')
self.assertEqual(entry.links[0]['rel'], 'self') self.assertEqual(entry.links[0]['rel'], 'self')
self.assertEqual(entry.links[1], { self.assertEqual(entry.links[1], {
'rel': 'describedby', 'rel': 'describedby',
'type': 'application/pdf', 'type': 'text/html',
'href': EXP_LINKS['v2.0']['pdf']}) 'href': EXP_LINKS['v2.0']['html']})
self.assertEqual(entry.links[2], {
'rel': 'describedby',
'type': 'application/vnd.sun.wadl+xml',
'href': EXP_LINKS['v2.0']['wadl'],
})