summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/api/openstack/views/images.py13
-rw-r--r--nova/tests/api/openstack/test_images.py4
2 files changed, 6 insertions, 11 deletions
diff --git a/nova/api/openstack/views/images.py b/nova/api/openstack/views/images.py
index 005341c62..fc4c1b55e 100644
--- a/nova/api/openstack/views/images.py
+++ b/nova/api/openstack/views/images.py
@@ -108,18 +108,17 @@ class ViewBuilderV11(ViewBuilder):
href = self.generate_href(image_obj["id"])
bookmark = self.generate_bookmark(image_obj["id"])
- if detail:
- image["metadata"] = image_obj.get("properties", {})
-
image["links"] = [{
"rel": "self",
"href": href,
- },
- {
- "rel": "bookmark",
- "href": bookmark,
}]
+ if detail:
+ image["metadata"] = image_obj.get("properties", {})
+ image["links"].append({"rel": "bookmark",
+ "href": bookmark,
+ })
+
return image
def generate_bookmark(self, image_id):
diff --git a/nova/tests/api/openstack/test_images.py b/nova/tests/api/openstack/test_images.py
index cf68f5f53..d45195286 100644
--- a/nova/tests/api/openstack/test_images.py
+++ b/nova/tests/api/openstack/test_images.py
@@ -559,10 +559,6 @@ class ImageControllerWithGlanceServiceTest(test.TestCase):
"links": [{
"rel": "self",
"href": href,
- },
- {
- "rel": "bookmark",
- "href": bookmark,
}],
}
self.assertTrue(test_image in response_list)