summaryrefslogtreecommitdiff
path: root/setup.cfg
diff options
context:
space:
mode:
authorAndrew Laski <andrew@lascii.com>2016-05-09 15:06:00 -0400
committerAndrew Laski <andrew@lascii.com>2016-06-06 10:12:04 -0400
commit474c120ae6de61c1f46523baa0fef11b5e537cf8 (patch)
treeb01f57671ea34540f37717781c4cf139428a1e5b /setup.cfg
parentea29939194663d6d1028a242cc880002bdfc8ace (diff)
downloadoslo-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.cfg3
1 files changed, 1 insertions, 2 deletions
diff --git a/setup.cfg b/setup.cfg
index 6ce85ce..1e812fb 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -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