From db3088b888e9560df93ff608b1e45a28fac14b6f Mon Sep 17 00:00:00 2001 From: Bill Owen Date: Fri, 27 Sep 2013 16:22:41 -0700 Subject: [PATCH] v2 api - return bootable attr value on volume list Add bootable to the list of values returned by display_list. This was returned in v1 api, and is still in v2 header, but was missed in the new implementation. Closes-Bug: #1232287 Change-Id: If7460b1c8ab4af417117c4bf6cfdccc5fcf21f46 --- cinder/api/v2/views/volumes.py | 3 ++- cinder/tests/api/v2/test_volumes.py | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/cinder/api/v2/views/volumes.py b/cinder/api/v2/views/volumes.py index b4fde24cd..0d13c4036 100644 --- a/cinder/api/v2/views/volumes.py +++ b/cinder/api/v2/views/volumes.py @@ -67,7 +67,8 @@ class ViewBuilder(common.ViewBuilder): 'source_volid': volume.get('source_volid'), 'metadata': self._get_volume_metadata(volume), 'links': self._get_links(request, volume['id']), - 'user_id': volume.get('user_id') + 'user_id': volume.get('user_id'), + 'bootable': str(volume.get('bootable')).lower() } } diff --git a/cinder/tests/api/v2/test_volumes.py b/cinder/tests/api/v2/test_volumes.py index a44dc737e..f4a8fe424 100644 --- a/cinder/tests/api/v2/test_volumes.py +++ b/cinder/tests/api/v2/test_volumes.py @@ -246,6 +246,7 @@ class VolumeApiTest(test.TestCase): 'status': 'fakestatus', 'description': 'displaydesc', 'availability_zone': 'fakeaz', + 'bootable': 'false', 'name': 'Updated Test Name', 'attachments': [ { @@ -292,6 +293,7 @@ class VolumeApiTest(test.TestCase): 'status': 'fakestatus', 'description': 'displaydesc', 'availability_zone': 'fakeaz', + 'bootable': 'false', 'name': 'displayname', 'attachments': [{ 'id': '1', @@ -349,6 +351,7 @@ class VolumeApiTest(test.TestCase): 'status': 'fakestatus', 'description': 'displaydesc', 'availability_zone': 'fakeaz', + 'bootable': 'false', 'name': 'displayname', 'attachments': [{ 'id': '1', @@ -446,6 +449,7 @@ class VolumeApiTest(test.TestCase): 'status': 'fakestatus', 'description': 'displaydesc', 'availability_zone': 'fakeaz', + 'bootable': 'false', 'name': 'displayname', 'attachments': [ { @@ -501,6 +505,7 @@ class VolumeApiTest(test.TestCase): 'status': 'fakestatus', 'description': 'displaydesc', 'availability_zone': 'fakeaz', + 'bootable': 'false', 'name': 'displayname', 'attachments': [ { @@ -832,6 +837,7 @@ class VolumeApiTest(test.TestCase): 'status': 'fakestatus', 'description': 'displaydesc', 'availability_zone': 'fakeaz', + 'bootable': 'false', 'name': 'displayname', 'attachments': [ { @@ -877,6 +883,7 @@ class VolumeApiTest(test.TestCase): 'status': 'fakestatus', 'description': 'displaydesc', 'availability_zone': 'fakeaz', + 'bootable': 'false', 'name': 'displayname', 'attachments': [], 'user_id': 'fakeuser', @@ -930,6 +937,7 @@ class VolumeApiTest(test.TestCase): 'status': 'fakestatus', 'description': 'displaydesc', 'availability_zone': 'fakeaz', + 'bootable': 'false', 'name': 'displayname', 'attachments': [ { -- 2.45.2