]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Use pecan controllers for routing
authorSalvatore Orlando <salv.orlando@gmail.com>
Fri, 14 Aug 2015 23:32:38 +0000 (16:32 -0700)
committerSalvatore Orlando <salv.orlando@gmail.com>
Fri, 18 Sep 2015 13:00:14 +0000 (06:00 -0700)
commit2c40310584826c69fbed01a3f31fb2a2dbc5243f
tree848047efed192bda1352b6b8b08231d8a59ca996
parent40151be9b3d7768de0c231f00d99f05371515c7b
Use pecan controllers for routing

Pecan defines several efficient mechanism for routing requests to
the appropriate controller, but the current code for Neutron's
Pecan WSGI server basically uses Pecan hooks to route requests.

This patch partially fixes that, removing the 'resource_identifier'
pecan hook and replacing it with explicit pecan routes between
controllers added at resource registration time.

All the remaining hooks, like attribute_population and
policy_enforments, which were relying on finding the resource
name in the pecan.request threadlocal variable have been updated.

This patch also:
- ensures the appropriate plugin is always selected for a given
  resource
- add a common NeutronPecanController base class for the classes
  CollectionsController and ItemaController
- Fixes the way in which plurals and singulars are handled in
  neutron.api.v2.resource_heper

Change-Id: I4ec0d2276c3974117b497228d289c3fb0dc5a140
14 files changed:
neutron/api/extensions.py
neutron/api/v2/resource_helper.py
neutron/manager.py
neutron/pecan_wsgi/app.py
neutron/pecan_wsgi/controllers/root.py
neutron/pecan_wsgi/hooks/__init__.py
neutron/pecan_wsgi/hooks/attribute_population.py
neutron/pecan_wsgi/hooks/context.py
neutron/pecan_wsgi/hooks/member_action.py [new file with mode: 0644]
neutron/pecan_wsgi/hooks/ownership_validation.py
neutron/pecan_wsgi/hooks/policy_enforcement.py
neutron/pecan_wsgi/hooks/quota_enforcement.py
neutron/pecan_wsgi/startup.py
neutron/tests/functional/pecan_wsgi/test_functional.py