POSTing a sample with a badly formatted timestamp raises 500 when it should raise a 400
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceilometer |
Fix Released
|
Undecided
|
Chris Dent | ||
WSME |
Fix Released
|
Undecided
|
Stéphane Bisinger |
Bug Description
The following request results in a 500 (due to the bad timestamp) but ought to result in a 400. The is caused by an apparently uncaught exception when processing the timestring. Most likely in WSME but potentially in the way Ceilometer is using WSME.
- name: post counter with bad timestamp
desc: bad timestamp results in 500
xfail: true
url: /v2/meters/apples
method: POST
request_
data:
- counter_name: apples
Changed in wsme: | |
milestone: | none → 0.8.0 |
status: | Fix Committed → Fix Released |
Changed in ceilometer: | |
assignee: | Mehdi Abaakouk (sileht) → Chris Dent (chdent) |
Changed in ceilometer: | |
milestone: | none → liberty-3 |
status: | Fix Committed → Fix Released |
Changed in ceilometer: | |
milestone: | liberty-3 → 5.0.0 |
This is fixed in the master branch.
Reviewed: https:/ /review. openstack. org/177026 /git.openstack. org/cgit/ stackforge/ wsme/commit/ ?id=f66cf4c3cc1 323ec563bdb22d2 6fb5c6b585b32f
Committed: https:/
Submitter: Jenkins
Branch: master
commit f66cf4c3cc1323e c563bdb22d26fb5 c6b585b32f
Author: Stéphane Bisinger <email address hidden>
Date: Fri Apr 24 00:55:09 2015 +0200
Raise an InvalidInput if you get a ValueError from JSON data.
When you parse JSON, if some parts of the message have the wrong type of data
you would get a ValueError, returning a 500 HTTP status code. Now the
ValueError gets wrapped in an InvalidInput which will result in a 400 HTTP
response sent back to the client.
Closes-Bug: #1392409 d194a29d593b23e 47dfd9bca3e
Change-Id: I7702b824a98185