Merge "Use EntityNotFound instead of ServiceNotFound"

This commit is contained in:
Jenkins 2015-12-01 08:01:45 +00:00 committed by Gerrit Code Review
commit 43ca997198
3 changed files with 4 additions and 7 deletions

View File

@ -403,10 +403,6 @@ class EventSendFailed(HeatException):
"on other engine (%(engine_id)s)")
class ServiceNotFound(HeatException):
msg_fmt = _("Service %(service_id)s not found")
class UnsupportedObjectError(HeatException):
msg_fmt = _('Unsupported object type %(objtype)s')

View File

@ -1020,7 +1020,7 @@ def service_delete(context, service_id, soft_delete=True):
def service_get(context, service_id):
result = model_query(context, models.Service).get(service_id)
if result is None:
raise exception.ServiceNotFound(service_id=service_id)
raise exception.EntityNotFound(entity='Service', name=service_id)
return result

View File

@ -2500,8 +2500,9 @@ class DBAPIServiceTest(common.HeatTestCase):
# Delete
db_api.service_delete(self.ctx, service.id, False)
self.assertRaises(exception.ServiceNotFound, db_api.service_get,
self.ctx, service.id)
ex = self.assertRaises(exception.EntityNotFound, db_api.service_get,
self.ctx, service.id)
self.assertEqual('Service', ex.kwargs.get('entity'))
class DBAPIResourceUpdateTest(common.HeatTestCase):