summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-06-15 23:03:14 +0000
committerGerrit Code Review <review@openstack.org>2012-06-15 23:03:14 +0000
commitfb9abcc83935b01746aeba0db4c431fe72b921fc (patch)
tree7859b583b2a4b95d7d673361aa3d71c7e02372f5 /nova/api
parentf1008417bf01e42ec30bccb436d0c14964aa7548 (diff)
parent2020fba6731634319a0d541168fbf45138825357 (diff)
downloadnova-fb9abcc83935b01746aeba0db4c431fe72b921fc.tar.gz
nova-fb9abcc83935b01746aeba0db4c431fe72b921fc.tar.xz
nova-fb9abcc83935b01746aeba0db4c431fe72b921fc.zip
Merge "Present correct ec2id format for volumes and snaps"
Diffstat (limited to 'nova/api')
-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):