diff options
| author | Chris Yeoh <cyeoh@au1.ibm.com> | 2013-04-22 10:51:00 +0930 |
|---|---|---|
| committer | Chris Yeoh <cyeoh@au1.ibm.com> | 2013-04-22 10:51:00 +0930 |
| commit | fd6fa90d5f293be7fac4f1e612958cc8e55ee796 (patch) | |
| tree | 0c194fd2866d9db89eb75f8f8a0fa14612c8b133 /nova/api | |
| parent | c62d7636b6ba1c36a96119a87fff8495c5a1dc21 (diff) | |
| download | nova-fd6fa90d5f293be7fac4f1e612958cc8e55ee796.tar.gz nova-fd6fa90d5f293be7fac4f1e612958cc8e55ee796.tar.xz nova-fd6fa90d5f293be7fac4f1e612958cc8e55ee796.zip | |
ec2 CreateVolumes/DescribeVolumes status mapping
'attaching' and 'detaching' are not valid ec2 API volume status
values. Instead map them both to 'in-use'.
Note this will not pass the devstack exercises until
https://review.openstack.org/#/c/27244/ goes through
Fixes bug #1074901
Change-Id: Id3dfd525d24d622aab5e350e42713fdb7671b31e
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/ec2/cloud.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 96206da58..4b779e26f 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -788,6 +788,10 @@ class CloudController(object): return {'volumeSet': volumes} def _format_volume(self, context, volume): + valid_ec2_api_volume_status_map = { + 'attaching': 'in-use', + 'detaching': 'in-use'} + instance_ec2_id = None instance_data = None @@ -801,7 +805,8 @@ class CloudController(object): instance['host']) v = {} v['volumeId'] = ec2utils.id_to_ec2_vol_id(volume['id']) - v['status'] = volume['status'] + v['status'] = valid_ec2_api_volume_status_map.get(volume['status'], + volume['status']) v['size'] = volume['size'] v['availabilityZone'] = volume['availability_zone'] v['createTime'] = volume['created_at'] |
