Add entity and name attribute to EntityNotFound

Since we use EntityNotFound for a bunch of not found cases.
We should have entity and name as attribute for cases that we need to
make sure the correctness when exception happens.

Change-Id: I782c372723f188bab38656e5b7cc401d23808ffb
This commit is contained in:
ricolin 2016-01-04 18:30:27 +08:00 committed by Rico Lin
parent b445f42ff0
commit 0bd2ecd555
1 changed files with 6 additions and 0 deletions

View File

@ -130,6 +130,12 @@ class InvalidTemplateReference(HeatException):
class EntityNotFound(HeatException):
msg_fmt = _("The %(entity)s (%(name)s) could not be found.")
def __init__(self, entity=None, name=None, **kwargs):
self.entity = entity
self.name = name
super(EntityNotFound, self).__init__(entity=entity, name=name,
**kwargs)
class PhysicalResourceNameAmbiguity(HeatException):
msg_fmt = _(