From 4339ecbb4f62a8de5048867262db75f17a8bf5a8 Mon Sep 17 00:00:00 2001 From: Rohan Rhishikesh Kanade Date: Wed, 12 Dec 2012 05:25:43 -0800 Subject: Fix for correctly parsing snapshot uuid in ec2api * EC2 snapshot id correctly translated instead of volume uuid. * Add unit tests changes for the existing test. Fixes LP Bug #1089371 Change-Id: Id650ba53dc6cda946531493e3887a01fc5d9bda4 --- nova/api/ec2/cloud.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'nova/api') diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 796505b57..2ee8fa157 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -131,11 +131,10 @@ def _parse_block_device_mapping(bdm): if ebs: ec2_id = ebs.pop('snapshot_id', None) if ec2_id: - id = ec2utils.ec2_vol_id_to_uuid(ec2_id) if ec2_id.startswith('snap-'): - bdm['snapshot_id'] = id + bdm['snapshot_id'] = ec2utils.ec2_snap_id_to_uuid(ec2_id) elif ec2_id.startswith('vol-'): - bdm['volume_id'] = id + bdm['volume_id'] = ec2utils.ec2_vol_id_to_uuid(ec2_id) ebs.setdefault('delete_on_termination', True) bdm.update(ebs) return bdm -- cgit