summaryrefslogtreecommitdiffstats
path: root/nova/api
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2011-09-01 14:02:02 +0000
committerTarmac <>2011-09-01 14:02:02 +0000
commit12ebed39bba39b4207344b90ec26323d4c251958 (patch)
tree0126a2fc816a64f27c4631e8994560721eae7c7c /nova/api
parent17de95f0c2b6431a4ae5bf39beb4d3cee2f843b2 (diff)
parent470b9dc73c5e27ef8716436fe22e9f32dbdffd28 (diff)
Fixes NotFound exceptions to show the proper instance id in the ec2 api.
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/ec2/__init__.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/nova/api/ec2/__init__.py b/nova/api/ec2/__init__.py
index ec4743cea..3b217e62e 100644
--- a/nova/api/ec2/__init__.py
+++ b/nova/api/ec2/__init__.py
@@ -399,18 +399,20 @@ class Executor(wsgi.Application):
except exception.InstanceNotFound as ex:
LOG.info(_('InstanceNotFound raised: %s'), unicode(ex),
context=context)
- return self._error(req, context, type(ex).__name__, ex.message)
+ ec2_id = ec2utils.id_to_ec2_id(ex.kwargs['instance_id'])
+ message = ex.message % {'instance_id': ec2_id}
+ return self._error(req, context, type(ex).__name__, message)
except exception.VolumeNotFound as ex:
LOG.info(_('VolumeNotFound raised: %s'), unicode(ex),
context=context)
- ec2_id = ec2utils.id_to_ec2_vol_id(ex.volume_id)
- message = _('Volume %s not found') % ec2_id
+ ec2_id = ec2utils.id_to_ec2_vol_id(ex.kwargs['volume_id'])
+ message = ex.message % {'volume_id': ec2_id}
return self._error(req, context, type(ex).__name__, message)
except exception.SnapshotNotFound as ex:
LOG.info(_('SnapshotNotFound raised: %s'), unicode(ex),
context=context)
- ec2_id = ec2utils.id_to_ec2_snap_id(ex.snapshot_id)
- message = _('Snapshot %s not found') % ec2_id
+ ec2_id = ec2utils.id_to_ec2_snap_id(ex.kwargs['snapshot_id'])
+ message = ex.message % {'snapshot_id': ec2_id}
return self._error(req, context, type(ex).__name__, message)
except exception.NotFound as ex:
LOG.info(_('NotFound raised: %s'), unicode(ex), context=context)