def _delete(self, req, id): """Deletes an existing servicemanage type.""" context = req.environ['monitor.context'] authorize(context) try: vol_type = servicemanage_types.get_servicemanage_type(context, id) servicemanage_types.destroy(context, vol_type['id']) except exception.NotFound: raise webob.exc.HTTPNotFound() return webob.Response(status_int=202)
def _check_type(self, context, type_id): try: servicemanage_types.get_servicemanage_type(context, type_id) except exception.NotFound as ex: raise webob.exc.HTTPNotFound(explanation=unicode(ex))