FaultWrapper middleware does not respect content types
Bug #790743 reported by
Dan Prince
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
Fix Released
|
Low
|
Dan Prince |
Bug Description
The OS API currently uses a FaultWrapper middleware which catches upstream exceptions and converts them into faults. This middleware does not currently respect the request content type. All exceptions are turned into XML response.
Additionally appears the actual error messages on faults are being masked. Fix these issues.
Related branches
lp:~rackspace-titan/nova/fix_faults
- Devin Carlen (community): Approve
- Jason Kölker (community): Approve
- Vish Ishaya (community): Approve
-
Diff: 316 lines (+37/-31)6 files modifiednova/api/openstack/consoles.py (+2/-1)
nova/api/openstack/contrib/multinic.py (+3/-2)
nova/api/openstack/contrib/volumes.py (+3/-2)
nova/api/openstack/faults.py (+1/-0)
nova/api/openstack/servers.py (+23/-26)
nova/tests/api/openstack/test_faults.py (+5/-0)
lp:~rackspace-titan/nova/osapi_fault_wrap_webob_exc
- Brian Waldon (community): Approve
- Devin Carlen (community): Approve
- Alex Meade (community): Approve
-
Diff: 763 lines (+90/-102)15 files modifiednova/api/openstack/accounts.py (+3/-3)
nova/api/openstack/backup_schedules.py (+4/-5)
nova/api/openstack/common.py (+12/-7)
nova/api/openstack/consoles.py (+3/-4)
nova/api/openstack/create_instance_helper.py (+3/-4)
nova/api/openstack/image_metadata.py (+2/-3)
nova/api/openstack/images.py (+1/-2)
nova/api/openstack/ips.py (+5/-6)
nova/api/openstack/server_metadata.py (+0/-1)
nova/api/openstack/servers.py (+42/-50)
nova/api/openstack/shared_ip_groups.py (+6/-7)
nova/api/openstack/users.py (+1/-2)
nova/api/openstack/wsgi.py (+5/-1)
nova/api/openstack/zones.py (+2/-6)
nova/tests/api/openstack/test_servers.py (+1/-1)
Changed in nova: | |
assignee: | nobody → Dan Prince (dan-prince) |
importance: | Undecided → Low |
Changed in nova: | |
status: | New → In Progress |
Changed in nova: | |
status: | In Progress → Fix Committed |
Changed in nova: | |
milestone: | none → diablo-3 |
Changed in nova: | |
milestone: | diablo-3 → 2011.3 |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
So for example this is what is actually returned (for a JSON request) when an error occurs:
<html> <head> <title>422 Unprocessable Entity</title> </head> <body> <h1>422 Unprocessable Entity</h1> Unable to process the contained instructions<br /><br /> </body> </html>
It should actually be something like this for a JSON request:
{"cloudServers Fault": {"message": "Unable to process the contained instructions", "code": 422}}
Also note that this only happens if the OS API controller actually throws an exception that isn't wrapped in faults.Fault. Many of them are however it seems like we are moving in the direction of just throwing the exceptions unwrapped.