~allenap/maas/xxx-a-thon

« back to all changes in this revision

Viewing changes to src/maasserver/api/support.py

  • Committer: Gavin Panella
  • Date: 2016-03-22 21:14:34 UTC
  • mfrom: (4657.1.157 maas)
  • Revision ID: gavin.panella@canonical.com-20160322211434-xzuovio86zvzo2js
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2012-2015 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2012-2016 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
"""Supporting infrastructure for Piston-based APIs in MAAS."""
200
200
    anonymous = None
201
201
 
202
202
    def dispatch(self, request, *args, **kwargs):
203
 
        signature = request.method.upper(), request.REQUEST.get("op")
 
203
        op = request.GET.get("op") or request.POST.get("op")
 
204
        signature = request.method.upper(), op
204
205
        function = self.exports.get(signature)
205
206
        if function is None:
206
207
            raise MAASAPIBadRequest(