]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
doc/_ext: ignore desc if it is unavailable 41120/head
authorKefu Chai <kchai@redhat.com>
Sun, 2 May 2021 11:57:27 +0000 (19:57 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 2 May 2021 11:57:29 +0000 (19:57 +0800)
there is chance that we don't have desc, desc_long or fmt_desc, in that
case, we should just skip desc before checking its length. so, just use
'if desc' which is able to check for None or empty string.

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

index 4d48664c927149f17a206be5230935977e9a22e1..e7b669b88f6bdd323c04faab6b32106b78d654e7 100644 (file)
@@ -19,7 +19,7 @@ logger = logging.getLogger(__name__)
 
 TEMPLATE = '''
 .. confval_option:: {{ opt.name }}
-{% if desc | length > 1 %}
+{% if desc %}
    {{ desc | wordwrap(70) | indent(3) }}
 {% endif %}
    :type: ``{{opt.type}}``