Merge lp:~allenap/maas/api-uri-bug-1059645 into lp:~maas-committers/maas/trunk
Status: | Merged |
---|---|
Approved by: | Gavin Panella |
Approved revision: | no longer in the source branch. |
Merged at revision: | 1324 |
Proposed branch: | lp:~allenap/maas/api-uri-bug-1059645 |
Merge into: | lp:~maas-committers/maas/trunk |
Diff against target: |
332 lines (+163/-16) 6 files modified
src/maasserver/api.py (+20/-4) src/maasserver/apidoc.py (+3/-8) src/maasserver/tests/test_api.py (+55/-0) src/maasserver/tests/test_apidoc.py (+4/-4) src/maasserver/utils/__init__.py (+18/-0) src/maasserver/utils/tests/test_utils.py (+63/-0) |
To merge this branch: | bzr merge lp:~allenap/maas/api-uri-bug-1059645 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Raphaël Badin (community) | Approve | ||
Review via email: mp+132527@code.launchpad.net |
This proposal supersedes a proposal from 2012-10-30.
Commit message
In the API description, make handler URIs absolute with respect to the request.
Previously, DEFAULT_MAAS_URL was always used.
Description of the change
I had to put a lot more work in to satisfy the review comments from jtv and jam, so I'm putting this back up for review.
The biggest change is that describe_handler now sets only a "path" field with the URI template; the describe() API function has to manufacture the "uri" field. I originally was using Django's HttpRequest.
These tests also highlighted that AnonFilesHandler was missing a resource_uri() method.
This tests if the 'scheme' matches appropriately. Would you also want to test a nested case? (so rather than foobar. com/MAAS/ 1.0/api something like foo.com/ bar/MAAS/ 1.0/api) .
Otherwise it seems good to me.