summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Prince <dan.prince@rackspace.com>2011-03-18 10:10:46 -0400
committerDan Prince <dan.prince@rackspace.com>2011-03-18 10:10:46 -0400
commita50deeb264ff721584d5b0a6ace749d8e2c44842 (patch)
treec49173432ed85d1c6db0669dfda95bdfe5159b89
parentabe147f756f13d4f968aa075d709e5c6643d310a (diff)
downloadnova-a50deeb264ff721584d5b0a6ace749d8e2c44842.tar.gz
nova-a50deeb264ff721584d5b0a6ace749d8e2c44842.tar.xz
nova-a50deeb264ff721584d5b0a6ace749d8e2c44842.zip
Change cloud.id_to_ec2_id to ec2utils.id_to_ec2_id. Fixes EC2 API error
handling when invalid instances and volume names are specified.
-rw-r--r--nova/api/ec2/__init__.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/nova/api/ec2/__init__.py b/nova/api/ec2/__init__.py
index fccebca5d..20701cfa8 100644
--- a/nova/api/ec2/__init__.py
+++ b/nova/api/ec2/__init__.py
@@ -31,7 +31,7 @@ from nova import log as logging
from nova import utils
from nova import wsgi
from nova.api.ec2 import apirequest
-from nova.api.ec2 import cloud
+from nova.api.ec2 import ec2utils
from nova.auth import manager
@@ -319,13 +319,13 @@ class Executor(wsgi.Application):
except exception.InstanceNotFound as ex:
LOG.info(_('InstanceNotFound raised: %s'), unicode(ex),
context=context)
- ec2_id = cloud.id_to_ec2_id(ex.instance_id)
+ ec2_id = ec2utils.id_to_ec2_id(ex.instance_id)
message = _('Instance %s not found') % 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 = cloud.id_to_ec2_id(ex.volume_id, 'vol-%08x')
+ ec2_id = ec2utils.id_to_ec2_id(ex.volume_id, 'vol-%08x')
message = _('Volume %s not found') % ec2_id
return self._error(req, context, type(ex).__name__, message)
except exception.NotFound as ex: