Add catch FlavorExtraSpecsNotFound in V2 API.
we catch FlavorExtraSpecsNotFound in v3 API but we didn't catch it at v2 API. This patch adds it and no need to add unit test because v2 v3 share unit test. Change-Id: I926b7cc443ccd9d0fea6a55bef4c3485ae7abe7d
This commit is contained in:
parent
f0ad0759e4
commit
f86377262c
|
@ -133,7 +133,8 @@ class FlavorExtraSpecsController(object):
|
||||||
flavor = objects.Flavor.get_by_flavor_id(context, flavor_id)
|
flavor = objects.Flavor.get_by_flavor_id(context, flavor_id)
|
||||||
del flavor.extra_specs[id]
|
del flavor.extra_specs[id]
|
||||||
flavor.save()
|
flavor.save()
|
||||||
except exception.FlavorNotFound as e:
|
except (exception.FlavorNotFound,
|
||||||
|
exception.FlavorExtraSpecsNotFound) as e:
|
||||||
raise exc.HTTPNotFound(explanation=e.format_message())
|
raise exc.HTTPNotFound(explanation=e.format_message())
|
||||||
except KeyError:
|
except KeyError:
|
||||||
msg = _("Flavor %(flavor_id)s has no extra specs with "
|
msg = _("Flavor %(flavor_id)s has no extra specs with "
|
||||||
|
|
Loading…
Reference in New Issue