Merge lp://qastaging/~salvatore-orlando/neutron/bug814518 into lp://qastaging/neutron/diablo

Proposed by Salvatore Orlando
Status: Merged
Approved by: Salvatore Orlando
Approved revision: 31
Merged at revision: 34
Proposed branch: lp://qastaging/~salvatore-orlando/neutron/bug814518
Merge into: lp://qastaging/neutron/diablo
Diff against target: 72 lines (+31/-3)
3 files modified
quantum/api/api_common.py (+7/-1)
tests/unit/test_api.py (+21/-0)
tests/unit/testlib_api.py (+3/-2)
To merge this branch: bzr merge lp://qastaging/~salvatore-orlando/neutron/bug814518
Reviewer Review Type Date Requested Status
dan wendlandt Approve
Brad Hall (community) Approve
Review via email: mp+70018@code.qastaging.launchpad.net

Description of the change

Fixing the issue causing a 400 error to not be raised if an invalid request body was specified.
The issue occurred in port creation, as the request body is optional; an invalid request body was simply ignored.

Also adding unit tests for creating a port without a request body in order to further improve code coverage.

To post a comment you must log in.
Revision history for this message
Brad Hall (bgh) wrote :

Looks good to me

review: Approve
Revision history for this message
dan wendlandt (danwent) wrote :

Change looks good.

This does remind me of something I was wondering when looking at the code earlier, though. Why do we call _deserialize() on the body for each iteration of the loop?

review: Approve
Revision history for this message
Salvatore Orlando (salvatore-orlando) wrote :

The _deserialize call is for parsing the request body from xml/json into a dictionary.
It is invoked only for operations which require a request body.

I think the Openstack API has a more sophisticated mechanism in which header/body deserialization is performed withing the wsgi middleware. We can do something similar in Quantum, but I don't think it is a high priority task at this stage.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches