From: Kefu Chai Date: Wed, 28 Apr 2021 02:39:04 +0000 (+0800) Subject: doc/_ext/ceph_confval: print "false" default values X-Git-Tag: v17.1.0~2113^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F41040%2Fhead;p=ceph.git doc/_ext/ceph_confval: print "false" default values 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 --- diff --git a/doc/_ext/ceph_confval.py b/doc/_ext/ceph_confval.py index 28f97e9975c8..98c5e2ff9493 100644 --- a/doc/_ext/ceph_confval.py +++ b/doc/_ext/ceph_confval.py @@ -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' %}