From: Kefu Chai Date: Sun, 2 May 2021 10:17:00 +0000 (+0800) Subject: doc/_ext: check "default" for None X-Git-Tag: v17.1.0~2092^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ab7cb630ae0a3d15152fd7e63fc1f36fd0003637;p=ceph.git 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 --- diff --git a/doc/_ext/ceph_confval.py b/doc/_ext/ceph_confval.py index 437678812a6a..4d48664c9271 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 is defined %} +{%- if default is not none %} {%- if opt.type == 'size' %} :default: ``{{ default | eval_size | iec_size }}`` {%- elif opt.type == 'secs' %}