tacker/releasenotes/notes/bug-1734316-change-response-code-e74907cb7c800bc7.yaml
Dinesh Bhor 3fbf7a9ae0 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
2017-11-28 09:00:39 +05:30

13 lines
483 B
YAML

---
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