Fix 500 when creating already on-boarded VNF
If you on-board a VNF to tacker and try to on-board it again tacker gives 500 InternalServerError. The response message user get is correct but the response code returned is incorrect which is 500. message returned: "vnfd already exist with given ['tenant_id', 'name', 'deleted_at']" The type of a TackerError returned is 'DuplicateEntity' which has 500 response code as it is derived from 'TackerException'. This patch changes the response code from 500 to 409 as this case is of HTTPConflict. This affects to below mentioned API's: * POST /v1.0/vnfds * POST /v1.0/vnfs * POST /v1.0/vims * POST /v1.0/nsds * POST /v1.0/nss NOTE: There are no existing unit test cases written for such API's. Closes-Bug: #1734316 Change-Id: I7f63ab5f9612c2f32f0f11397ad0d6e3cee2f8d6
This commit is contained in:
parent
cc03b5d952
commit
3fbf7a9ae0
@ -0,0 +1,13 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixes `bug 1734316`_ which will return correct response codes for below
|
||||
API's:
|
||||
|
||||
- POST /v1.0/vnfds - old_response: 500, new_response: 409
|
||||
- POST /v1.0/vnfs - old_response: 500, new_response: 409
|
||||
- POST /v1.0/vims - old_response: 500, new_response: 409
|
||||
- POST /v1.0/nsds - old_response: 500, new_response: 409
|
||||
- POST /v1.0/nss - old_response: 500, new_response: 409
|
||||
|
||||
.. _bug 1734316: https://bugs.launchpad.net/tacker/+bug/1734316
|
@ -281,5 +281,5 @@ class DuplicateResourceName(TackerException):
|
||||
message = _("%(resource)s with name %(name)s already exists")
|
||||
|
||||
|
||||
class DuplicateEntity(TackerException):
|
||||
class DuplicateEntity(Conflict):
|
||||
message = _("%(_type)s already exist with given %(entry)s")
|
||||
|
Loading…
x
Reference in New Issue
Block a user