6754635010
Jinja2 templates rendered using Python 3 interpreter, are required to conform with Python 3 new semantics. singed-off-by: Tamer Ahmed <tamer.ahmed@microsoft.com>
21 lines
483 B
Django/Jinja
21 lines
483 B
Django/Jinja
[
|
|
{% set ports_with_speed_set=[] %}
|
|
{% if PORT %}
|
|
{% for port in PORT %}
|
|
{% if 'speed' in PORT[port] %}
|
|
{%- if ports_with_speed_set.append(port) -%}{%- endif -%}
|
|
{%- endif -%}
|
|
{% endfor %}
|
|
{% for port in ports_with_speed_set %}
|
|
{
|
|
"PORT_TABLE:{{ port }}": {
|
|
"speed": "{{ PORT[port]['speed'] }}",
|
|
"description": "{{ PORT[port]['description'] }}"
|
|
},
|
|
"OP": "SET"
|
|
}{% if not loop.last %},{% endif %}
|
|
|
|
{% endfor %}
|
|
{% endif %}
|
|
]
|