From e90c9cf811a5fde4f8749ff45463329c7b280070 Mon Sep 17 00:00:00 2001 From: cchoate54 <114622132+cchoate54@users.noreply.github.com> Date: Wed, 2 Nov 2022 09:44:52 -0700 Subject: [PATCH] Update bgpd.main.conf.j2 bgpd.main.conf.j2: bugfix-9739 * Update bgpd.main.conf.j2 to gracefully handle the bgp configuration cases for when 'bgp_asn' is set to 'None', 'Null', or missing. Signed-off-by: cchoate54@gmail.com --- dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 b/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 index b5891b9695ac..4cee01ac973d 100644 --- a/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 +++ b/dockers/docker-fpm-frr/frr/bgpd/bgpd.main.conf.j2 @@ -61,6 +61,7 @@ route-map HIDE_INTERNAL permit 20 ! {% endif %} ! +{% if (DEVICE_METADATA is defined) and ('localhost' in DEVICE_METADATA) and ('bgp_asn' in DEVICE_METADATA['localhost']) and (DEVICE_METADATA['localhost']['bgp_asn'].lower() != 'none') and (DEVICE_METADATA['localhost']['bgp_asn'].lower() != 'null') %} router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} ! {% block bgp_init %} @@ -143,6 +144,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }} exit-address-family {% endblock maximum_paths %} {% endif %} +{% endif %} ! ! end of template: bgpd/bgpd.main.conf.j2 !