neutron/neutron/pecan_wsgi
Salvatore Orlando 0f9a607cf6 Pecan: Streamline request body processing
This patch simplifies the process for validating the request body for
POST and PUT requests and preparing it for dispatching to plugins.

In particular it removes the need for parsing the URL to find the
resource identifier, and instead leverages Pecan's routing engine
to extract it. As a result the attribute population hook now simply
deals with request body validation, and has been renamed accordingly.

The logic for loading the current state of the object from the plugin
in order to enforce authZ policy on PUT requests has been moved to
the appropriate hook, PolicyEnforcementHook.

The logic for managing plural/singular names for resource has also been
improved, and two helper functions to retrieve a resource's attributes
have been added to neutron.api.v2.attributes

The logic for aborting requests with unsupported HTTP methods has also
been moved to the REST controllers. It used to be in PolicyEnforcementHook,
which was probably not the right thing to do.

This patch also unskips a functional test concerning ownership checks,
and add functional tests for verifying correct request processing.
Unit tests for the newly added helper functions are also provided.

Related blueprint wsgi-pecan-switch

Change-Id: Ib26998b37bdeec8af7a97f77b66d421b8cd271da
2016-01-11 04:07:34 -08:00
..
controllers Pecan: Streamline request body processing 2016-01-11 04:07:34 -08:00
hooks Pecan: Streamline request body processing 2016-01-11 04:07:34 -08:00
__init__.py Rename 'newapi' to 'pecan_wsgi' 2015-09-02 15:53:34 +00:00
app.py Pecan: Streamline request body processing 2016-01-11 04:07:34 -08:00
startup.py Move i18n to _i18n, as per oslo_i18n guidelines 2015-12-01 19:29:10 -07:00