Currently, when trying to create an audit which misses a mandatory
parameter watcher returns error 500 instead of 400 which is the
documented error in the API [1] and the appropiate error code for
malformed requests.
This patch catch parameters validation errors according to the json
schema for each strategy and returns error 400. It also fixes the
unit test to validate the expected behavior.
[1] https://docs.openstack.org/api-ref/resource-optimization/#audits
Closes-Bug: #2110538
Change-Id: I23232b3b54421839bb01d54386d4e7b244f4e2a0
(cherry picked from commit 4629402f38)
Signed-off-by: Alfredo Moralejo <amoralej@redhat.com>
8 lines
259 B
YAML
8 lines
259 B
YAML
---
|
|
fixes:
|
|
- |
|
|
`Bug #2110538 <https://bugs.launchpad.net/watcher/+bug/2110538>`_:
|
|
Corrected the HTTP error code returned when watcher users try to create
|
|
audits with invalid parameters. The API now correctly returns a 400 Bad
|
|
Request error.
|