Bugfix #9739: Support when 'bgp_asn' is set to 'None', 'Null', or missing. (#12588)

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.

How I did it
Include a conditional statement to avoid configuring bgp in FRR when 'bgp_asn' is missing or set to 'None' or 'Null'

How to verify it
Configure 'bgp_asn' as 'None', 'Null' or have it missing from configurations and verify that /etc/frr/bgpd.conf does not have invalid bgp configurations like 'router bgp None'

Description for the changelog
Update bgpd.main.conf.j2 to gracefully handle the bgp configuration cases for when 'bgp_asn' is set to 'None', 'Null', or missing for bugfix 9739.

Signed-off-by: cchoate54@gmail.com
This commit is contained in:
Caitlin Choate 2022-11-08 16:53:14 -08:00 committed by GitHub
parent ac5d89c6ac
commit 66f1cc458d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
!