diff options
author | Anusha Unnam <anusha.unnam@intel.com> | 2017-03-17 15:48:47 +0000 |
---|---|---|
committer | Anusha Unnam <anusha.unnam@intel.com> | 2017-03-17 21:19:29 +0000 |
commit | 395177145622a5c37b8cfb53989084e2ff03ad98 (patch) | |
tree | 7f503db3e27781fb0e4cf05b3b9eea7ad68b35d4 | |
parent | bb33bf3a6dcbb15e43125bafd90832cac7f2c69c (diff) | |
download | oslo-policy-395177145622a5c37b8cfb53989084e2ff03ad98.tar.gz |
Comment out the rule from generated sample-policy file1.21.0
blueprint policy-docs
Change-Id: I8077f15c6b231b13c3f96ed5325795958c2cb75f
-rw-r--r-- | oslo_policy/generator.py | 2 | ||||
-rw-r--r-- | oslo_policy/tests/test_generator.py | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/oslo_policy/generator.py b/oslo_policy/generator.py index aaf8019..14284ad 100644 --- a/oslo_policy/generator.py +++ b/oslo_policy/generator.py @@ -110,7 +110,7 @@ def _format_rule_default_yaml(default, include_help=True): {'name': default.name, 'check_str': default.check_str}) if include_help: - text = ('%(help)s\n%(text)s\n' % + text = ('%(help)s\n#%(text)s\n' % {'help': _format_help_text(default.description), 'text': text}) return text diff --git a/oslo_policy/tests/test_generator.py b/oslo_policy/tests/test_generator.py index e94fc6c..dca75f9 100644 --- a/oslo_policy/tests/test_generator.py +++ b/oslo_policy/tests/test_generator.py @@ -89,17 +89,17 @@ class GenerateSampleTestCase(base.PolicyBaseTestCase): extensions=extensions, namespace=['base_rules', 'rules']) expected = '''# Basic admin check -"admin": "is_admin:True" +#"admin": "is_admin:True" # This is a long description to check that line wrapping functions # properly -"owner": "project_id:%(project_id)s" +#"owner": "project_id:%(project_id)s" # -"shared": "field:networks:shared=True" +#"shared": "field:networks:shared=True" # -"admin_or_owner": "rule:admin or rule:owner" +#"admin_or_owner": "rule:admin or rule:owner" ''' output_file = self.get_config_file_fullname('policy.yaml') @@ -126,17 +126,17 @@ class GenerateSampleTestCase(base.PolicyBaseTestCase): extensions=extensions, namespace=['base_rules', 'rules']) expected = '''# Basic admin check -"admin": "is_admin:True" +#"admin": "is_admin:True" # This is a long description to check that line wrapping functions # properly -"owner": "project_id:%(project_id)s" +#"owner": "project_id:%(project_id)s" # -"shared": "field:networks:shared=True" +#"shared": "field:networks:shared=True" # -"admin_or_owner": "rule:admin or rule:owner" +#"admin_or_owner": "rule:admin or rule:owner" ''' stdout = self._capture_stdout() @@ -168,7 +168,7 @@ class GenerateSampleTestCase(base.PolicyBaseTestCase): expected = '''# Check Summary # # This is a description to check that empty line has no white spaces. -"admin": "is_admin:True" +#"admin": "is_admin:True" ''' output_file = self.get_config_file_fullname('policy.yaml') |