]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Use function registration for policy checks
authorKevin L. Mitchell <kevin.mitchell@rackspace.com>
Thu, 2 Aug 2012 19:09:23 +0000 (14:09 -0500)
committerKevin L. Mitchell <kevin.mitchell@rackspace.com>
Mon, 6 Aug 2012 15:00:47 +0000 (10:00 -0500)
commit03079191cd26d98e3b20c90d8929e408853c2bf5
tree5e4e78a7046734d222fe4d6948688be19ba999ef
parent12628f6f0590740b0d3f543620d184a10397ca0e
Use function registration for policy checks

The original policy framework allowed new policy checks to be created
through inheritance.  This is somewhat clunky and unnecessary in
Python.  This change refactors policy.py to allow new policy checks
to be registered using an @register() decorator.  One consequence is
that HttpBrain is deprecated.

Care has been taken to ensure backwards compatibility; deprecation
warnings will be emitted for uses of HttpBrain or the inheritance-
based checks.

(Pull-up from openstack-common, with deprecation of HttpBrain.)

Change-Id: I0aa78d1128e55aa7d59558c62128105c01da8f1b
quantum/openstack/common/policy.py
quantum/policy.py