Add policy sample generation

This adds the entry point and config file necessary for using the
oslo.policy sample generation script. It also adds a tox target to
simplify the usage of it.

Change-Id: I7feb522b2ea5f56e48982169c7ebbb2ec2ef2cb3
Partially-Implements: bp policy-in-code
This commit is contained in:
Anthony Washington 2017-03-08 22:53:24 +00:00
parent 3432685a1e
commit 9bb1556817
3 changed files with 11 additions and 0 deletions

View File

@ -0,0 +1,3 @@
[DEFAULT]
output_file = etc/keystone.policy.yaml.sample
namespace = keystone

View File

@ -184,6 +184,11 @@ oslo.config.opts =
oslo.config.opts.defaults = oslo.config.opts.defaults =
keystone = keystone.conf:set_external_opts_defaults keystone = keystone.conf:set_external_opts_defaults
oslo.policy.policies =
# With the move of default policy in code list_rules returns a list of
# the default defined polices.
keystone = keystone.common.policies:list_rules
paste.filter_factory = paste.filter_factory =
healthcheck = oslo_middleware:Healthcheck.factory healthcheck = oslo_middleware:Healthcheck.factory
cors = oslo_middleware:CORS.factory cors = oslo_middleware:CORS.factory

View File

@ -123,6 +123,9 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen
[testenv:genconfig] [testenv:genconfig]
commands = oslo-config-generator --config-file=config-generator/keystone.conf commands = oslo-config-generator --config-file=config-generator/keystone.conf
[testenv:genpolicy]
commands = oslopolicy-sample-generator --config-file etc/keystone-policy-generator.conf
[hacking] [hacking]
import_exceptions = import_exceptions =
keystone.i18n keystone.i18n