diff options
| author | Alex Meade <alex.meade@rackspace.com> | 2011-07-07 14:51:12 -0400 |
|---|---|---|
| committer | Alex Meade <alex.meade@rackspace.com> | 2011-07-07 14:51:12 -0400 |
| commit | e9d712c52830725b24f20da7ff8662e97d22014d (patch) | |
| tree | 6d0400588774fc6954fa0dbdca043d3454f3af89 | |
| parent | 162b9651c3e251d8acae764f08372f764597f8ca (diff) | |
Removed bookmark link from non detailed image viewbuilder
| -rw-r--r-- | nova/api/openstack/views/images.py | 13 | ||||
| -rw-r--r-- | nova/tests/api/openstack/test_images.py | 4 |
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) |
