Merge lp:~rvb/maas/expose-maas-1.2 into lp:maas/1.2

Proposed by Raphaël Badin
Status: Merged
Approved by: Raphaël Badin
Approved revision: no longer in the source branch.
Merged at revision: 1339
Proposed branch: lp:~rvb/maas/expose-maas-1.2
Merge into: lp:maas/1.2
Diff against target: 55 lines (+9/-4)
2 files modified
src/maasserver/api.py (+7/-2)
src/maasserver/urls_api.py (+2/-2)
To merge this branch: bzr merge lp:~rvb/maas/expose-maas-1.2
Reviewer Review Type Date Requested Status
Raphaël Badin (community) Approve
Review via email: mp+140919@code.launchpad.net

Commit message

Fix MAASHandler (add a resource_uri method) so that it is scanned by the CLI.

To post a comment you must log in.
Revision history for this message
Raphaël Badin (rvb) wrote :

This is not a simple backport because the original branch included some drive-by fixes that could not make it into 1.2 but this is simple enough for me to self-review and similar to what was done in the trunk branch (https://code.launchpad.net/~rvb/maas/expose-maas/+merge/140916).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/api.py'
2--- src/maasserver/api.py 2012-12-13 02:39:45 +0000
3+++ src/maasserver/api.py 2012-12-20 15:03:06 +0000
4@@ -63,6 +63,7 @@
5 "BootImagesHandler",
6 "FilesHandler",
7 "get_oauth_token",
8+ "MaasHandler",
9 "NodeGroupsHandler",
10 "NodeGroupInterfaceHandler",
11 "NodeGroupInterfacesHandler",
12@@ -1685,8 +1686,8 @@
13 return ('tags_handler', [])
14
15
16-class MAASHandler(OperationsHandler):
17- """Manage the MAAS' itself."""
18+class MaasHandler(OperationsHandler):
19+ """Manage the MAAS server."""
20 create = read = update = delete = None
21
22 @operation(idempotent=False)
23@@ -1715,6 +1716,10 @@
24 value = Config.objects.get_config(name)
25 return HttpResponse(json.dumps(value), content_type='application/json')
26
27+ @classmethod
28+ def resource_uri(cls, *args, **kwargs):
29+ return ('maas_handler', [])
30+
31
32 # Title section for the API documentation. Matches in style, format,
33 # etc. whatever render_api_docs() produces, so that you can concatenate
34
35=== modified file 'src/maasserver/urls_api.py'
36--- src/maasserver/urls_api.py 2012-09-20 15:10:28 +0000
37+++ src/maasserver/urls_api.py 2012-12-20 15:03:06 +0000
38@@ -23,7 +23,7 @@
39 BootImagesHandler,
40 describe,
41 FilesHandler,
42- MAASHandler,
43+ MaasHandler,
44 NodeGroupHandler,
45 NodeGroupInterfaceHandler,
46 NodeGroupInterfacesHandler,
47@@ -58,7 +58,7 @@
48
49
50 # Admin handlers.
51-maas_handler = AdminRestrictedResource(MAASHandler, authentication=api_auth)
52+maas_handler = AdminRestrictedResource(MaasHandler, authentication=api_auth)
53 nodegroupinterface_handler = AdminRestrictedResource(
54 NodeGroupInterfaceHandler, authentication=api_auth)
55 nodegroupinterfaces_handler = AdminRestrictedResource(

Subscribers

People subscribed via source and target branches

to status/vote changes: