fix formatting for empty defaults

When the default for a policy rule is empty, the output is ````. The
rst parser interprets that as a title overline or underline, and
sphinx dies. When we have no default rule emit a string saying so to
avoid emitting an empty literal inline block.

Closes-Bug: 1707246
Change-Id: I774b2de5ff59874dfa67811c094735dd74c8083e
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2017-07-28 13:35:33 -04:00 committed by Lance Bragstad
parent 540503294c
commit 2b99c39c30
1 changed files with 4 additions and 1 deletions

View File

@ -51,7 +51,10 @@ def _format_policy_rule(rule):
"""
yield '``{}``'.format(rule.name)
yield _indent(':Default: ``{}``'.format(rule.check_str))
if rule.check_str:
yield _indent(':Default: ``{}``'.format(rule.check_str))
else:
yield _indent(':Default: <empty string>')
if hasattr(rule, 'operations'):
yield _indent(':Operations:')