summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/api/openstack/views/images.py10
-rw-r--r--nova/tests/api/openstack/test_images.py4
2 files changed, 12 insertions, 2 deletions
diff --git a/nova/api/openstack/views/images.py b/nova/api/openstack/views/images.py
index d1f89a785..5c0510377 100644
--- a/nova/api/openstack/views/images.py
+++ b/nova/api/openstack/views/images.py
@@ -101,6 +101,16 @@ class ViewBuilderV11(ViewBuilder):
serverRef = image_obj['properties']['instance_ref']
image['server'] = {
"id": common.get_id_from_href(serverRef),
+ "links": [
+ {
+ "rel": "self",
+ "href": serverRef,
+ },
+ {
+ "rel": "bookmark",
+ "href": common.remove_version_from_href(serverRef),
+ },
+ ]
}
except KeyError:
return
diff --git a/nova/tests/api/openstack/test_images.py b/nova/tests/api/openstack/test_images.py
index 696493d4f..c1ead6e28 100644
--- a/nova/tests/api/openstack/test_images.py
+++ b/nova/tests/api/openstack/test_images.py
@@ -1096,7 +1096,7 @@ class ImageControllerWithGlanceServiceTest(test.TestCase):
self.assertEqual(200, response.status_int)
result = json.loads(response.body)
expected = {
- 'id': '1',
+ 'id': 1,
'links': [
{
'rel': 'self',
@@ -1123,7 +1123,7 @@ class ImageControllerWithGlanceServiceTest(test.TestCase):
self.assertEqual(200, response.status_int)
result = json.loads(response.body)
expected = {
- 'id': '1',
+ 'id': 1,
'links': [
{
'rel': 'self',