summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--nova/api/ec2/ec2utils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/api/ec2/ec2utils.py b/nova/api/ec2/ec2utils.py
index 7ad2033ce..c46b3cffd 100644
--- a/nova/api/ec2/ec2utils.py
+++ b/nova/api/ec2/ec2utils.py
@@ -145,7 +145,7 @@ def id_to_ec2_snap_id(snapshot_id):
if utils.is_uuid_like(snapshot_id):
ctxt = context.get_admin_context()
int_id = get_int_id_from_snapshot_uuid(ctxt, snapshot_id)
- return id_to_ec2_id(int_id)
+ return id_to_ec2_id(int_id, 'snap-%08x')
else:
return id_to_ec2_id(snapshot_id, 'snap-%08x')
@@ -155,7 +155,7 @@ def id_to_ec2_vol_id(volume_id):
if utils.is_uuid_like(volume_id):
ctxt = context.get_admin_context()
int_id = get_int_id_from_volume_uuid(ctxt, volume_id)
- return id_to_ec2_id(int_id)
+ return id_to_ec2_id(int_id, 'vol-%08x')
else:
return id_to_ec2_id(volume_id, 'vol-%08x')
@@ -175,7 +175,7 @@ def get_int_id_from_volume_uuid(context, volume_uuid):
try:
return db.get_ec2_volume_id_by_uuid(context, volume_uuid)
except exception.NotFound:
- raise exception.VolumeNotFound()
+ return db.ec2_volume_create(context, volume_uuid)['id']
def get_volume_uuid_from_int_id(context, int_id):
@@ -197,7 +197,7 @@ def get_int_id_from_snapshot_uuid(context, snapshot_uuid):
try:
return db.get_ec2_snapshot_id_by_uuid(context, snapshot_uuid)
except exception.NotFound:
- raise exception.SnapshotNotFound()
+ return db.ec2_snapshot_create(context, snapshot_uuid)['id']
def get_snapshot_uuid_from_int_id(context, int_id):