summaryrefslogtreecommitdiff
path: root/src/conf_mode/protocols_bgp.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2025-11-26 21:12:21 +0100
committerGitHub <noreply@github.com>2025-11-26 21:12:21 +0100
commit1f03d36aca57dd07cfb8b273e3c5be2200047be4 (patch)
tree7141d0ba45b77ce483ab4459c73e2a0f43b21d1b /src/conf_mode/protocols_bgp.py
parentac73349435651789d240f2c4f72fe6f7bcdd6661 (diff)
parentcc4d2167cf756d37cc60c3e415b2ac30f622b85b (diff)
downloadvyos-1x-1f03d36aca57dd07cfb8b273e3c5be2200047be4.tar.gz
vyos-1x-1f03d36aca57dd07cfb8b273e3c5be2200047be4.zip
Merge pull request #4869 from c-po/T8034
frr: T8034: use dict_search() for routing protocols to check if VRF is used
Diffstat (limited to 'src/conf_mode/protocols_bgp.py')
-rwxr-xr-xsrc/conf_mode/protocols_bgp.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/protocols_bgp.py b/src/conf_mode/protocols_bgp.py
index fe5740a18..a7b9ea39b 100755
--- a/src/conf_mode/protocols_bgp.py
+++ b/src/conf_mode/protocols_bgp.py
@@ -184,7 +184,8 @@ def verify(config_dict):
vrf = config_dict['vrf_context']
# eqivalent of the C foo ? 'a' : 'b' statement
- bgp = vrf and config_dict['vrf']['name'][vrf]['protocols']['bgp'] or config_dict['bgp']
+ bgp = vrf and dict_search(f'vrf.name.{vrf}.protocols.bgp',
+ config_dict) or config_dict['bgp']
bgp['policy'] = config_dict['policy']
if 'deleted' in bgp:
@@ -331,7 +332,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']: