]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Add te field user_id into the volume detailed information.
authorVincent Hou <sbhou@cn.ibm.com>
Tue, 16 Jul 2013 03:12:32 +0000 (23:12 -0400)
committerVincent Hou <sbhou@cn.ibm.com>
Tue, 16 Jul 2013 03:46:09 +0000 (23:46 -0400)
Fixed Bug 1200555.

Change-Id: Ibc36453caa174432b69597b1b2a0b314a7730357

cinder/api/v2/views/volumes.py
cinder/tests/api/v2/test_volumes.py

index 41ba40bc9a6601422a1f09607c782e16f941a104..b4fde24cd4afae38da2b6ce1371ba2b9696a5571 100644 (file)
@@ -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')
             }
         }
 
index 72f89746620a77a35e0d76fd51d6571e0fdbccd6..e2dbc17616f1195a432c6fcccb34baae1b1c5e8a 100644 (file)
@@ -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,