Skip to content

Commit 6e716ce

Browse files
committed
[Fixbug]: Crash if VNET isn't defined in config db
Signed-off-by: zegan <zegan@microsoft.com>
1 parent a8b68a4 commit 6e716ce

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

dockers/docker-fpm-frr/frr.conf.j2

+4
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ route-map FROM_BGP_SPEAKER_V4 permit 10
8080
route-map TO_BGP_SPEAKER_V4 deny 10
8181
!
8282
! Vnet BGP instance
83+
{% block vnet_bgp_instance %}
84+
{% if VNET is defined %}
8385
{% for vnet_name, vnet_metadata in VNET.iteritems() %}
8486
router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} vrf {{ vnet_name }}
8587
no bgp default ipv4-unicast
@@ -131,6 +133,8 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} vrf {{ vnet_name }}
131133
advertise ipv4 unicast
132134
exit-address-family
133135
{% endfor %}
136+
{% endif %}
137+
{% endblock vnet_bgp_instance %}
134138
!
135139
router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
136140
bgp log-neighbor-changes

0 commit comments

Comments
 (0)