diff --git a/nova/api/openstack/compute/versions.py b/nova/api/openstack/compute/versions.py index 61c607ad7b..50717fa7cf 100644 --- a/nova/api/openstack/compute/versions.py +++ b/nova/api/openstack/compute/versions.py @@ -27,16 +27,10 @@ CONF.import_opt('enabled', 'nova.api.openstack', group='osapi_v3') LINKS = { 'v2.0': { - 'pdf': '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' + 'html': 'http://docs.openstack.org/' }, 'v3.0': { - 'pdf': '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' + 'html': 'http://docs.openstack.org/' }, } @@ -49,13 +43,8 @@ VERSIONS = { "links": [ { "rel": "describedby", - "type": "application/pdf", - "href": LINKS['v2.0']['pdf'], - }, - { - "rel": "describedby", - "type": "application/vnd.sun.wadl+xml", - "href": LINKS['v2.0']['wadl'], + "type": "text/html", + "href": LINKS['v2.0']['html'], }, ], "media-types": [ @@ -76,13 +65,8 @@ VERSIONS = { "links": [ { "rel": "describedby", - "type": "application/pdf", - "href": LINKS['v3.0']['pdf'], - }, - { - "rel": "describedby", - "type": "application/vnd.sun.wadl+xml", - "href": LINKS['v3.0']['wadl'], + "type": "text/html", + "href": LINKS['v3.0']['html'], }, ], "media-types": [ diff --git a/nova/tests/api/openstack/compute/plugins/v3/test_versions.py b/nova/tests/api/openstack/compute/plugins/v3/test_versions.py index 6a912d911f..b3aab29761 100644 --- a/nova/tests/api/openstack/compute/plugins/v3/test_versions.py +++ b/nova/tests/api/openstack/compute/plugins/v3/test_versions.py @@ -28,16 +28,10 @@ NS = { EXP_LINKS = { 'v2.0': { - 'pdf': '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' + 'html': 'http://docs.openstack.org/' }, 'v3.0': { - 'pdf': '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' + 'html': 'http://docs.openstack.org/' }, } @@ -54,13 +48,8 @@ EXP_VERSIONS = { }, { "rel": "describedby", - "type": "application/pdf", - "href": EXP_LINKS['v2.0']['pdf'], - }, - { - "rel": "describedby", - "type": "application/vnd.sun.wadl+xml", - "href": EXP_LINKS['v2.0']['wadl'], + "type": "text/html", + "href": EXP_LINKS['v2.0']['html'], }, ], "media-types": [ @@ -85,13 +74,8 @@ EXP_VERSIONS = { }, { "rel": "describedby", - "type": "application/pdf", - "href": EXP_LINKS['v3.0']['pdf'], - }, - { - "rel": "describedby", - "type": "application/vnd.sun.wadl+xml", - "href": EXP_LINKS['v3.0']['wadl'], + "type": "text/html", + "href": EXP_LINKS['v3.0']['html'], }, ], "media-types": [ diff --git a/nova/tests/api/openstack/compute/test_versions.py b/nova/tests/api/openstack/compute/test_versions.py index 51cd9a1f0b..b77cc2462e 100644 --- a/nova/tests/api/openstack/compute/test_versions.py +++ b/nova/tests/api/openstack/compute/test_versions.py @@ -37,10 +37,7 @@ NS = { EXP_LINKS = { 'v2.0': { - 'pdf': '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', + 'html': 'http://docs.openstack.org/', }, } @@ -53,13 +50,8 @@ EXP_VERSIONS = { "links": [ { "rel": "describedby", - "type": "application/pdf", - "href": EXP_LINKS['v2.0']['pdf'], - }, - { - "rel": "describedby", - "type": "application/vnd.sun.wadl+xml", - "href": EXP_LINKS['v2.0']['wadl'], + "type": "text/html", + "href": EXP_LINKS['v2.0']['html'], }, ], "media-types": [ @@ -147,13 +139,8 @@ class VersionsTest(test.NoDBTestCase): }, { "rel": "describedby", - "type": "application/pdf", - "href": EXP_LINKS['v2.0']['pdf'], - }, - { - "rel": "describedby", - "type": "application/vnd.sun.wadl+xml", - "href": EXP_LINKS['v2.0']['wadl'], + "type": "text/html", + "href": EXP_LINKS['v2.0']['html'], }, ], "media-types": [ @@ -191,13 +178,8 @@ class VersionsTest(test.NoDBTestCase): }, { "rel": "describedby", - "type": "application/pdf", - "href": EXP_LINKS['v2.0']['pdf'], - }, - { - "rel": "describedby", - "type": "application/vnd.sun.wadl+xml", - "href": EXP_LINKS['v2.0']['wadl'], + "type": "text/html", + "href": EXP_LINKS['v2.0']['html'], }, ], "media-types": [ @@ -289,16 +271,12 @@ class VersionsTest(test.NoDBTestCase): self.assertEqual(len(entry.content), 1) self.assertEqual(entry.content[0].value, '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]['rel'], 'self') self.assertEqual(entry.links[1], { - 'href': EXP_LINKS['v2.0']['pdf'], - 'type': 'application/pdf', - 'rel': 'describedby'}) - self.assertEqual(entry.links[2], { - 'href': EXP_LINKS['v2.0']['wadl'], - 'type': 'application/vnd.sun.wadl+xml', + 'href': EXP_LINKS['v2.0']['html'], + 'type': 'text/html', 'rel': 'describedby'}) def test_get_version_list_atom(self): @@ -696,13 +674,8 @@ class VersionsSerializerTests(test.NoDBTestCase): }, { "rel": "describedby", - "type": "application/pdf", - "href": EXP_LINKS['v2.0']['pdf'], - }, - { - "rel": "describedby", - "type": "application/vnd.sun.wadl+xml", - "href": EXP_LINKS['v2.0']['wadl'], + "type": "text/html", + "href": EXP_LINKS['v2.0']['html'], }, ], "media-types": [ @@ -741,15 +714,10 @@ class VersionsSerializerTests(test.NoDBTestCase): self.assertEqual(len(entry.content), 1) self.assertEqual(entry.content[0].value, '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]['rel'], 'self') self.assertEqual(entry.links[1], { 'rel': 'describedby', - 'type': 'application/pdf', - 'href': EXP_LINKS['v2.0']['pdf']}) - self.assertEqual(entry.links[2], { - 'rel': 'describedby', - 'type': 'application/vnd.sun.wadl+xml', - 'href': EXP_LINKS['v2.0']['wadl'], - }) + 'type': 'text/html', + 'href': EXP_LINKS['v2.0']['html']})