[docker-orchagent]: ports.json.j2 template fixed (#1177)
* Template generates a correct output now, without excess comma in case the last port in list has no port speed setting in the redis-db Signed-off-by: Denis Maslov <Denis.Maslov@cavium.com>
This commit is contained in:
parent
ead47b66a0
commit
379451ef2b
@ -1,13 +1,14 @@
|
||||
[
|
||||
{% if PORT %}
|
||||
{% set ns = {'firstPrinted': False} %}
|
||||
{% for port in PORT %}
|
||||
{% if PORT[port].has_key('speed') %}
|
||||
{
|
||||
{% if ns.firstPrinted %},{% endif %}{
|
||||
"PORT_TABLE:{{ port }}": {
|
||||
"speed": "{{ PORT[port]['speed'] }}"
|
||||
},
|
||||
"OP": "SET"
|
||||
}{% if not loop.last %},{% endif %}
|
||||
}{% if ns.update({'firstPrinted': True}) %} {% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
Reference in New Issue
Block a user