sonic-buildimage/dockers/docker-orchagent/ports.json.j2
Shuotian Cheng 1859f53206 [swss]: Fix missing comma in the ports.json.j2 file (#1217)
Add J2 test case as well as a sample output

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
2017-12-08 09:06:22 -08:00

17 lines
339 B
Django/Jinja

[
{% if PORT %}
{% for port in PORT %}
{% if PORT[port].has_key('speed') %}
{
"PORT_TABLE:{{ port }}": {
"speed": "{{ PORT[port]['speed'] }}",
"description": "{{ PORT[port]['description'] }}"
},
"OP": "SET"
}{% if not loop.last %},{% endif %}
{% endif %}
{% endfor %}
{% endif %}
]