]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix v2 API policy checks when keystone is in use.
authorDan Wendlandt <dan@nicira.com>
Sun, 8 Jul 2012 19:34:22 +0000 (12:34 -0700)
committerDan Wendlandt <dan@nicira.com>
Sun, 8 Jul 2012 19:34:27 +0000 (12:34 -0700)
commit7d5db13b915ed1617b18cca6e84393f148e62285
tree35f95fd7d3a79592eeb54e3a905dff08affe85c0
parentbb2b244fe371b7df995cb38189a12963579304eb
Fix v2 API policy checks when keystone is in use.

bug 1022032.  There were significant errors in how
the policy framework was being invoked, but existing
tests did now show them, since they always invoked the
API with no keystone context.  This patch fixes those
issues and add a significant amount of test coverage
simulating API calls with keystone enabled.

As part of this patch, we also needed to add a tenant-id
attribute to the subnet object.  Furthermore, we
changed the API validation code to prevent tenant-id from
being changed with a PUT, since changing it after creation
could invalidate some of the create checks we're planning
on adding (e.g., that a port is being created on a network
owned by the same tenant).

Change-Id: I6da61f0d4ac3b259aa0afcd42cfa8e6ec1a9b035
quantum/api/v2/base.py
quantum/api/v2/router.py
quantum/db/db_base_plugin_v2.py
quantum/db/models_v2.py
quantum/tests/unit/test_api_v2.py
quantum/tests/unit/test_db_plugin.py