]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
doc/_ext/ceph_confval: print "false" default values 41040/head
authorKefu Chai <kchai@redhat.com>
Wed, 28 Apr 2021 02:39:04 +0000 (10:39 +0800)
committerKefu Chai <kchai@redhat.com>
Wed, 28 Apr 2021 02:39:12 +0000 (10:39 +0800)
before this change, we check the exisitence of default value of an
option using "if default", but this is wrong. what if "default" is an
empty string or a numeric value of 0, or just False?

after this change, its exisitence is checked using "if default is
defined", so all "false" default values are rendered as well.

Signed-off-by: Kefu Chai <kchai@redhat.com>
doc/_ext/ceph_confval.py

index 28f97e9975c8fb24fbfd0a3d40becc0abe4d6da9..98c5e2ff94937551540ca8b0e345f9e552c31839 100644 (file)
@@ -23,7 +23,7 @@ TEMPLATE = '''
    {{ desc | wordwrap(70) | indent(3) }}
 {% endif %}
    :type: ``{{opt.type}}``
-{%- if default %}
+{%- if default is defined %}
   {%- if opt.type == 'size' %}
    :default: ``{{ default | eval_size | iec_size }}``
   {%- elif opt.type == 'secs' %}