]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
doc/_ext: check "default" for None
authorKefu Chai <kchai@redhat.com>
Sun, 2 May 2021 10:17:00 +0000 (18:17 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 2 May 2021 10:17:02 +0000 (18:17 +0800)
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>
doc/_ext/ceph_confval.py

index 437678812a6ae49ff1aad5484264a6b9b9c28c84..4d48664c927149f17a206be5230935977e9a22e1 100644 (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' %}