Merge lp://staging/~johannes.erdfelt/nova/lp844905 into lp://staging/~hudson-openstack/nova/trunk
Status: | Rejected | ||||
---|---|---|---|---|---|
Rejected by: | Brian Waldon | ||||
Proposed branch: | lp://staging/~johannes.erdfelt/nova/lp844905 | ||||
Merge into: | lp://staging/~hudson-openstack/nova/trunk | ||||
Diff against target: |
827 lines (+522/-81) 7 files modified
etc/nova/api-paste.ini (+1/-1) nova/api/openstack/urlmap.py (+297/-0) nova/api/openstack/versions.py (+6/-27) nova/api/openstack/wsgi.py (+24/-28) nova/tests/api/openstack/fakes.py (+1/-1) nova/tests/api/openstack/test_urlmap.py (+111/-0) nova/tests/api/openstack/test_versions.py (+82/-24) |
||||
To merge this branch: | bzr merge lp://staging/~johannes.erdfelt/nova/lp844905 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brian Waldon (community) | Approve | ||
Paul Voccio (community) | Abstain | ||
Review via email: mp+76439@code.staging.launchpad.net |
Commit message
The 1.1 API specifies that the API version can be determined by URL path (eg /v1.1/tenant/
This branch adds support for looking at the Content-Type and Accept headers for the API version to use.
Description of the change
The 1.1 API specifies that the API version can be determined by URL path (eg /v1.1/tenant/
This branch adds support for looking at the Content-Type and Accept headers for the API version to use.
This merge proposal is more of a code review than a claim than the branch is ready. I'd like to hear opinions on the direction of the branch.
In particular:
* The approach I took using a custom URLMap class to integrate into paste deploy. It has the benefit of still allowing the paste config to enable/disable API versions. It subclasses a paste class, so it may end up being fragile in the long term.
* To support this correctly, the accepted content type needs to be determined much earlier than before (so we get the right version specified by the MIME type in the Accept header). Unfortunately, there are a couple of resources that define an additional supported content type of application/
* Much of the current code tests like to skip the paste deploy part of the WSGI stack. Also the direct API doesn't use paste deploy. As a result, I left in code to determine the accepted content type at a later point. I originally went down the path of changing the rest of the code, but that resulted in a set of huge changes, but also some corner cases where only part of the WSGI stack is intentionally tested.
Unmerged revisions
- 1591. By Johannes Erdfelt
-
Add docstrings to tests to better document the intent
- 1590. By Johannes Erdfelt
-
Cleanup docstrings
Remove is_filename option, it's not necessary for us and is a hack anyway - 1589. By Johannes Erdfelt
-
Remove FIXME now that it has a workaround
- 1588. By Johannes Erdfelt
-
Remove hardcoded content type now that the code handles direct API again
- 1587. By Johannes Erdfelt
-
Accept application/
atom+xml for a few exceptions as well - 1586. By Johannes Erdfelt
-
Add content type tests
- 1585. By Johannes Erdfelt
-
PEP8 cleanup
- 1584. By Johannes Erdfelt
-
Merge with trunk
- 1583. By Johannes Erdfelt
-
Start adding some unit tests
- 1582. By Johannes Erdfelt
-
Rename to urlmap to better reflect the purpose
Finding it hard to see that the new code is being properly covered by the tests.
Ideally I'd like to see explicit unit tests on each of the new methods added (and ensuring they hit each of the conditional branches).
At the very least, some description in the unit tests as to what they are actually testing and which methods are being touched. But ideally, simple single-method unit tests.