summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Yeoh <cyeoh@au1.ibm.com>2013-04-18 15:44:59 +0930
committerChris Yeoh <cyeoh@au1.ibm.com>2013-04-19 12:53:07 +0930
commitc62d7636b6ba1c36a96119a87fff8495c5a1dc21 (patch)
tree6cf148e50577aaffbea8aa0111d674fb665e1012
parent964df95013fe65d38b3675592ae02249e93d2bc5 (diff)
downloadnova-c62d7636b6ba1c36a96119a87fff8495c5a1dc21.tar.gz
nova-c62d7636b6ba1c36a96119a87fff8495c5a1dc21.tar.xz
nova-c62d7636b6ba1c36a96119a87fff8495c5a1dc21.zip
Fix ec2 CreateVolumes/DescribeVolumes status
In admin context CreateVolumes/DescribeVolumes returns extraneous information such as project_id, host, instance data etc. This results in output which is not compatible with the ec2 API. This change removes the addition of the extra information. This only partially fixes bug #1074901 as mapping the internal volume states to ones specified by the ec2 api results in the devstack euca.sh exercises to fail. But that can't be fixed until the fix in this patch is through as the extraneous information returned by DescribeVolumes causes euca-describe-volumes to not to show the attachment state for a volume which is needed by the euca exercises. Change-Id: I48a96fbfe4bb2e3da9514d688638ecdf3a168303
-rw-r--r--nova/api/ec2/cloud.py8
-rw-r--r--nova/tests/api/ec2/test_cinder_cloud.py1
2 files changed, 1 insertions, 8 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py
index 3d210404c..96206da58 100644
--- a/nova/api/ec2/cloud.py
+++ b/nova/api/ec2/cloud.py
@@ -805,14 +805,6 @@ class CloudController(object):
v['size'] = volume['size']
v['availabilityZone'] = volume['availability_zone']
v['createTime'] = volume['created_at']
- if context.is_admin:
- # NOTE(dprince): project_id and host_id are unset w/ Cinder
- v['status'] = '%s (%s, %s, %s, %s)' % (
- volume['status'],
- volume.get('project_id', ''),
- volume.get('host', ''),
- instance_data,
- volume['mountpoint'])
if volume['attach_status'] == 'attached':
v['attachmentSet'] = [{'attachTime': volume['attach_time'],
'deleteOnTermination': False,
diff --git a/nova/tests/api/ec2/test_cinder_cloud.py b/nova/tests/api/ec2/test_cinder_cloud.py
index ffb2b4948..1751343ce 100644
--- a/nova/tests/api/ec2/test_cinder_cloud.py
+++ b/nova/tests/api/ec2/test_cinder_cloud.py
@@ -174,6 +174,7 @@ class CinderCloudTestCase(test.TestCase):
size=1,
name='test-1',
description='test volume 1')
+ self.assertEqual(vol1['status'], 'available')
vol2 = self.cloud.create_volume(self.context,
size=1,
name='test-2',