]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Fix accessing shared policies, add assoc tests
authorJohn Schwarz <jschwarz@redhat.com>
Sun, 26 Jul 2015 13:00:12 +0000 (16:00 +0300)
committerIhar Hrachyshka <ihrachys@redhat.com>
Sat, 1 Aug 2015 17:03:44 +0000 (19:03 +0200)
commit3b97f79ab7756a8737df53405b3dd458e79752be
tree26ea1b87ac54b6015afc4103e7aa19144938fa0a
parent11924b11532979090abdba9960dd2dad81debcfe
Fix accessing shared policies, add assoc tests

This patch is two-fold:
1. Previously, policies that were created using the 'shared=True' flag
   were not accessible to other tenants, since the context used to
   search the policies was not elevated. This patch elevates the context
   prior to retrieving the policy, and if a match was found, makes sure
   that the user has permissions to access it (either the policy is
   shared or it's from the same tenant id).
2. Tests for both associations and disassociations of policies to both
   networks and ports are added in this patch, to make sure coverage is
   good and that the problem is fixed.

Change-Id: Idec13ff4ec575b6d0c0a455c1b3bd9d9700ff7fb
neutron/objects/qos/policy.py
neutron/services/qos/qos_extension.py
neutron/tests/api/base.py
neutron/tests/api/test_qos.py
neutron/tests/tempest/services/network/json/network_client.py
neutron/tests/unit/objects/qos/test_policy.py