doc/_ext: check "default" for None

default could be None and we don't reference the default value using
`opt.default`, so this variable is always defined. to avoid printing
a None default value, check for a None value. see
https://jinja.palletsprojects.com/en/2.11.x/templates/#none

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2021-05-02 18:17:00 +08:00
parent d1aacf555e
commit ab7cb630ae

View File

@ -23,7 +23,7 @@ TEMPLATE = '''
{{ desc | wordwrap(70) | indent(3) }}
{% endif %}
:type: ``{{opt.type}}``
{%- if default is defined %}
{%- if default is not none %}
{%- if opt.type == 'size' %}
:default: ``{{ default | eval_size | iec_size }}``
{%- elif opt.type == 'secs' %}