diff options
| author | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2011-08-02 16:30:41 +0000 |
|---|---|---|
| committer | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2011-08-02 16:30:41 +0000 |
| commit | 9c8b8bdf3144b1b0459bd2533cdade3138b643f3 (patch) | |
| tree | 48b50285ba7cd91b9f8affe3e35eeb65127df0f4 /nova/compute | |
| parent | 8e7a4e6147cb78b28fc2a2131591dbd37de2fa30 (diff) | |
| parent | 83066aa64ccba34e23063eee661375b11de2161f (diff) | |
pull-up from trunk
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/api.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/nova/compute/api.py b/nova/compute/api.py index 8f7b3c3ef..aae16d1da 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -940,18 +940,15 @@ class API(base.Base): LOG.debug(_("Old instance type %(current_instance_type_name)s, " " new instance type %(new_instance_type_name)s") % locals()) if not new_instance_type: - raise exception.ApiError(_("Requested flavor %(flavor_id)d " - "does not exist") % locals()) + raise exception.FlavorNotFound(flavor_id=flavor_id) current_memory_mb = current_instance_type['memory_mb'] new_memory_mb = new_instance_type['memory_mb'] if current_memory_mb > new_memory_mb: - raise exception.ApiError(_("Invalid flavor: cannot downsize" - "instances")) + raise exception.CannotResizeToSmallerSize() if (current_memory_mb == new_memory_mb) and flavor_id: - raise exception.ApiError(_("Invalid flavor: cannot use" - "the same flavor. ")) + raise exception.CannotResizeToSameSize() instance_ref = self._get_instance(context, instance_id, 'resize') self._cast_scheduler_message(context, |
