Commit f2774c31 authored by Fabrice Roy's avatar Fabrice Roy
Browse files

remove lists from rst if they are empty

parent 3d3133e3
Pipeline #7134 passed with stages
in 2 minutes and 24 seconds
......@@ -96,7 +96,7 @@ def json_mesolist_to_rst(url):
for meso in data['mesocentreList']:
region = meso['location']
meso_list.setdefault(region, []).append(build_meso(meso))
result = _json_mesolist_rst_template.render(meso_by_region=meso_list)
print(result)
return result
......@@ -118,6 +118,7 @@ _json_mesolist_rst_template = _json_mesolist_rst_env.from_string(dedent("""
{{ l }}
{%- endfor %}
{% if(meso['cluster_list']) %}
.. cluster_list::
{% for cluster in meso["cluster_list"] %}
......@@ -126,6 +127,7 @@ _json_mesolist_rst_template = _json_mesolist_rst_env.from_string(dedent("""
{{ l }}
{%- endfor %}
{% if(cluster['node_type_list']) %}
.. node_type_list::
{% for node_type in cluster["node_type_list"] %}
......@@ -135,7 +137,9 @@ _json_mesolist_rst_template = _json_mesolist_rst_env.from_string(dedent("""
{%- endfor %}
{% endfor %}
{% endif %}
{% if(cluster['storage_list']) %}
.. cluster_storage_list::
{% for storage in cluster["storage_list"] %}
......@@ -145,9 +149,12 @@ _json_mesolist_rst_template = _json_mesolist_rst_env.from_string(dedent("""
{%- endfor %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
{% if(meso['storage_list']) %}
.. storage_list::
{% for storage in meso["storage_list"] %}
......@@ -157,6 +164,7 @@ _json_mesolist_rst_template = _json_mesolist_rst_env.from_string(dedent("""
{%- endfor %}
{% endfor %}
{% endif %}
{%- endfor %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment