Skip to content

Commit

Permalink
fix sample_golden_config_db.j2 portchannel undefined (#15311)
Browse files Browse the repository at this point in the history
Add portchannel check to sample_golden_config_db.j2 to resolve errors
for topos (specifically mx) that do not have portchannels for
golden_config_infra/test_config_reload_with_rendered_golden_config.py
when running `sonic-cfggen -d -t /tmp/golden_config_db.j2 > /etc/sonic/golden_config_db.json`
  • Loading branch information
dayouliu1 authored Nov 13, 2024
1 parent 265843c commit b27f64f
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{% set portchannels= [] %}
{% for pc, value in PORTCHANNEL.items() %}
{% set _ = portchannels.append(pc) %}
{% endfor %}
{% if PORTCHANNEL is defined %}
{% for pc, value in PORTCHANNEL.items() %}
{% set _ = portchannels.append(pc) %}
{% endfor %}
{% endif %}

{
"NEW_FEATURE": {
Expand Down

0 comments on commit b27f64f

Please sign in to comment.