diff options
author | Andrew Laski <andrew@lascii.com> | 2016-05-09 15:06:00 -0400 |
---|---|---|
committer | Andrew Laski <andrew@lascii.com> | 2016-06-06 10:12:04 -0400 |
commit | 474c120ae6de61c1f46523baa0fef11b5e537cf8 (patch) | |
tree | b01f57671ea34540f37717781c4cf139428a1e5b /setup.cfg | |
parent | ea29939194663d6d1028a242cc880002bdfc8ace (diff) | |
download | oslo-policy-474c120ae6de61c1f46523baa0fef11b5e537cf8.tar.gz |
Add sample file generation script and helper methods1.9.0
This adds a console script to oslo.policy that will output a sample
policy file in yaml format. It works by looking at the configured
namespace(s) under an 'oslo.policy.policies' entry point. A method, or
methods, should be provided which return a list of
oslo_policy.policy.RuleDefault objects.
To use this script add an entry to setup.cfg in a project with something
like:
oslo.policy.policies =
nova.api = nova.api.opts:list_policies
list_policies should be a method which returns a list of
oslo_policy.policy.RuleDefault objects.
Then run it like:
oslopolicy-sample-generator --namespace nova.api
--output-file can also be specified, or those options can be configured
in a file which can be specified with --config-file.
Change-Id: If25d48313b91a6610119220e13f635c6e28b2a59
Partially-Implements: bp policy-sample-generation
Diffstat (limited to 'setup.cfg')
-rw-r--r-- | setup.cfg | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -32,8 +32,7 @@ oslo.config.opts = console_scripts = oslopolicy-checker = oslo_policy.shell:main - - + oslopolicy-sample-generator = oslo_policy.generator:generate_sample [build_sphinx] source-dir = doc/source |