From: Vincent Hou Date: Tue, 16 Jul 2013 03:12:32 +0000 (-0400) Subject: Add te field user_id into the volume detailed information. X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=c562ac705229710068c7f57fb87d2ab0f4fe54a0;p=openstack-build%2Fcinder-build.git Add te field user_id into the volume detailed information. Fixed Bug 1200555. Change-Id: Ibc36453caa174432b69597b1b2a0b314a7730357 --- diff --git a/cinder/api/v2/views/volumes.py b/cinder/api/v2/views/volumes.py index 41ba40bc9..b4fde24cd 100644 --- a/cinder/api/v2/views/volumes.py +++ b/cinder/api/v2/views/volumes.py @@ -66,7 +66,8 @@ class ViewBuilder(common.ViewBuilder): 'snapshot_id': volume.get('snapshot_id'), 'source_volid': volume.get('source_volid'), 'metadata': self._get_volume_metadata(volume), - 'links': self._get_links(request, volume['id']) + 'links': self._get_links(request, volume['id']), + 'user_id': volume.get('user_id') } } diff --git a/cinder/tests/api/v2/test_volumes.py b/cinder/tests/api/v2/test_volumes.py index 72f897466..e2dbc1761 100644 --- a/cinder/tests/api/v2/test_volumes.py +++ b/cinder/tests/api/v2/test_volumes.py @@ -239,6 +239,7 @@ class VolumeApiTest(test.TestCase): 'device': '/', } ], + 'user_id': 'fakeuser', 'volume_type': 'vol_type_name', 'snapshot_id': None, 'source_volid': None, @@ -280,6 +281,7 @@ class VolumeApiTest(test.TestCase): 'host_name': None, 'device': '/', }], + 'user_id': 'fakeuser', 'volume_type': 'vol_type_name', 'snapshot_id': None, 'source_volid': None, @@ -373,6 +375,7 @@ class VolumeApiTest(test.TestCase): 'volume_id': '1' } ], + 'user_id': 'fakeuser', 'volume_type': 'vol_type_name', 'snapshot_id': None, 'source_volid': None, @@ -608,6 +611,7 @@ class VolumeApiTest(test.TestCase): 'volume_id': '1' } ], + 'user_id': 'fakeuser', 'volume_type': 'vol_type_name', 'snapshot_id': None, 'source_volid': None, @@ -644,6 +648,7 @@ class VolumeApiTest(test.TestCase): 'availability_zone': 'fakeaz', 'name': 'displayname', 'attachments': [], + 'user_id': 'fakeuser', 'volume_type': 'vol_type_name', 'snapshot_id': None, 'source_volid': None,