OSAPI: Create server 500 error when malformed bodies
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Brian Waldon |
Bug Description
Currently, fault handling when performing create server requests with a malformed body is often incorrect.
These should be returning 400s or 422s instead of 500s and have useful error messages.
This may encompass or be related to numerous bugs such as bug 797250 and bug 798969
using the following command with different bodies results in many different 500 errors:
curl -X POST -H "Content-Type: application/json" -d '{"server": {"name": "cow"}}' -v -H "Accept: application/xml" -H "X-Auth-Token: ${NOVA_TOKEN}" http://
{"server": {"name": "cow"}}
results in:
<cloudServersFault code="500" xmlns="http://
<message>
'imageRef'
</message>
</cloudServersF
{"server"
results in:
<cloudServersFault code="500" xmlns="http://
<message>
'unicode' object has no attribute 'get'
</message>
</cloudServersF
Related branches
- Josh Kearney (community): Approve
- Devin Carlen (community): Approve
- Chris Behrens (community): Approve
-
Diff: 79 lines (+57/-1)2 files modifiednova/api/openstack/servers.py (+5/-1)
nova/tests/api/openstack/test_servers.py (+52/-0)
tags: | added: osapi-v1.1 |
Changed in nova: | |
status: | In Progress → Fix Committed |
Changed in nova: | |
milestone: | none → essex-1 |
Changed in nova: | |
status: | Fix Committed → Fix Released |
Changed in nova: | |
milestone: | essex-1 → 2012.1 |
Related to bug 816601