Improve the returned Message for nsd-create
When creating nsd with non-existent vnfd in tosca template, we got internal error. This patch will fix this and will return with NotFound error. Partially Implements: blueprint improve-return-message Closes-Bug: #1710801 Change-Id: I7e9da552673088fe36e244d4658ad243e21a1fca
This commit is contained in:
parent
e88a482576
commit
be6ceb11f7
|
@ -58,7 +58,7 @@ class BadRequest(TackerException):
|
|||
|
||||
|
||||
class NotFound(TackerException):
|
||||
pass
|
||||
message = _('%(resource)s %(name)s not Found')
|
||||
|
||||
|
||||
class Conflict(TackerException):
|
||||
|
|
|
@ -341,6 +341,8 @@ class VNFMPluginDb(vnfm.VNFMPluginBase, db_base.CommonDbMixin):
|
|||
|
||||
def get_vnfd(self, context, vnfd_id, fields=None):
|
||||
vnfd_db = self._get_resource(context, VNFD, vnfd_id)
|
||||
if not vnfd_db:
|
||||
raise exceptions.NotFound(resource='VNFD', name=vnfd_id)
|
||||
return self._make_vnfd_dict(vnfd_db)
|
||||
|
||||
def get_vnfds(self, context, filters, fields=None):
|
||||
|
|
Loading…
Reference in New Issue