Skip to content

Commit

Permalink
Merge branch 'fix-sonic-config-interface-null' into fix-sonic-undefin…
Browse files Browse the repository at this point in the history
…ed-port-values
  • Loading branch information
iljarotar committed Nov 8, 2024
2 parents 740264e + 9d9879b commit 046500f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions partition/roles/sonic/templates/metal.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ MGMT_VRF_CONFIG:
vrf_global:
mgmtVrfEnabled: "{{ sonic_mgmt_vrf | lower }}"
{% if sonic_ports_dict|length > 0 %}
{% set ports_with_vrf_exist = sonic_ports_dict.items() | map('last') | map(attribute="vrf", default="") | select('regex', '.+') | length > 0 %}
{% set ports_with_ips_exist = sonic_ports_dict.items() | map('last') | map(attribute="ips", default="") | select('regex', '.+') | length > 0 %}
{% set ports_intersect_with_bgp_ports = sonic_ports_dict.items() | map('first') | intersect(sonic_bgp_ports) | length > 0 %}
{% if ports_with_vrf_exist or ports_with_ips_exist or ports_intersect_with_bgp_ports %}

INTERFACE:
{% endif %}
{% for name, port in sonic_ports_dict.items() %}
{% if name in sonic_bgp_ports|default([]) or port.vrf is defined %}
{{ name }}:
Expand Down

0 comments on commit 046500f

Please sign in to comment.