diff options
| author | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2011-07-29 19:52:11 +0000 |
|---|---|---|
| committer | Kevin L. Mitchell <kevin.mitchell@rackspace.com> | 2011-07-29 19:52:11 +0000 |
| commit | 73711a9e260fd8b6f747b9c8f09511eba149a1fb (patch) | |
| tree | ef91156b5b04e85e03bfab44629966e8130d4290 /nova/compute | |
| parent | 62c7ca622a42aaed9a4f23e8fc2167655b2ff58f (diff) | |
| parent | 6703e33a68d0653f486d679337b4dfc4239eba34 (diff) | |
pull-up from trunk
Diffstat (limited to 'nova/compute')
| -rw-r--r-- | nova/compute/instance_types.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/nova/compute/instance_types.py b/nova/compute/instance_types.py index c13a629a9..824416514 100644 --- a/nova/compute/instance_types.py +++ b/nova/compute/instance_types.py @@ -132,11 +132,8 @@ def get_instance_type_by_name(name): # flavors. def get_instance_type_by_flavor_id(flavor_id): """Retrieve instance type by flavor_id.""" - if flavor_id is None: - return get_default_instance_type() + ctxt = context.get_admin_context() try: - ctxt = context.get_admin_context() return db.instance_type_get_by_flavor_id(ctxt, flavor_id) - except exception.DBError, e: - LOG.exception(_('DB error: %s') % e) - raise exception.ApiError(_("Unknown flavor: %s") % flavor_id) + except ValueError: + raise exception.FlavorNotFound(flavor_id=flavor_id) |
