summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-09-26 21:30:50 +0200
committerChristian Breunig <christian@breunig.cc>2025-09-26 21:30:50 +0200
commit7da3fcc9b7306f2e241716aa26b518540f3e3471 (patch)
tree3b43f506bbeb82a7f362cb3bedec9ef1dd223fea /src
parent3f8404ac78e1a31e8afcacc6ce8e7331130d2093 (diff)
downloadvyos-1x-7da3fcc9b7306f2e241716aa26b518540f3e3471.tar.gz
vyos-1x-7da3fcc9b7306f2e241716aa26b518540f3e3471.zip
bgp: T7760: improfe verify() logic on default VRF removal
After commit 85fe32f0e ("bgp: T7760: remove per vrf instance system-as node") BGP isntances running in a VRF will no longer have a system-as node set. This results in "set vrf name <name> protocols bgp" becomeing a valid CLI path. When reading in the config dict - we now might see {'protocols': {'bgp': {}} as a valid entry. We do need to account for this empty dictionary.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index 4e7f09d0e..696981012 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -200,7 +200,7 @@ def verify(config_dict):
if 'dependent_vrfs' in bgp:
for vrf, vrf_options in bgp['dependent_vrfs'].items():
if vrf != 'default':
- if dict_search('protocols.bgp', vrf_options):
+ if 'protocols' in vrf_options and 'bgp' in vrf_options['protocols']:
dependent_vrfs = ', '.join(bgp['dependent_vrfs'].keys())
raise ConfigError(f'Cannot delete default BGP instance, ' \
f'dependent VRF instance(s): {dependent_vrfs}')
@@ -343,7 +343,7 @@ def verify(config_dict):
peer_group = peer_config['interface']['v6only']['peer_group']
if 'remote_as' in peer_config['interface']['v6only'] and 'remote_as' in bgp['peer_group'][peer_group]:
raise ConfigError(f'Peer-group member "{peer}" cannot override remote-as of peer-group "{peer_group}"!')
-
+
for afi in ['ipv4_unicast', 'ipv4_multicast', 'ipv4_labeled_unicast', 'ipv4_flowspec',
'ipv6_unicast', 'ipv6_multicast', 'ipv6_labeled_unicast', 'ipv6_flowspec',
'l2vpn_evpn']: