From 4d0774e534766d70961975933635e6c54dcc1982 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Wed, 11 Dec 2024 21:35:54 +0100 Subject: vrf: T6746: bugfix change of VNI VNI was always retrieved via effective configuration and not active configuration. --- python/vyos/configdict.py | 4 ++-- smoketest/scripts/cli/test_vrf.py | 2 +- src/conf_mode/vrf.py | 15 ++------------- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/python/vyos/configdict.py b/python/vyos/configdict.py index 9522d8fcc..fb6365060 100644 --- a/python/vyos/configdict.py +++ b/python/vyos/configdict.py @@ -1100,8 +1100,8 @@ def get_frrender_dict(conf, argv=None) -> dict: vrf['name'][vrf_name]['protocols'].update({'static': {'deleted' : ''}}) vrf_vni_path = ['vrf', 'name', vrf_name, 'vni'] - if conf.exists_effective(vrf_vni_path): - vrf_config.update({'vni': conf.return_effective_value(vrf_vni_path)}) + if conf.exists(vrf_vni_path): + vrf_config.update({'vni': conf.return_value(vrf_vni_path)}) dict.update({'vrf' : vrf}) elif conf.exists_effective(vrf_cli_path): diff --git a/smoketest/scripts/cli/test_vrf.py b/smoketest/scripts/cli/test_vrf.py index 3cab5248e..f4ed1a61f 100755 --- a/smoketest/scripts/cli/test_vrf.py +++ b/smoketest/scripts/cli/test_vrf.py @@ -23,7 +23,7 @@ from json import loads from jmespath import search from vyos.configsession import ConfigSessionError -from vyos.frr import mgmt_daemon +from vyos.frrender import mgmt_daemon from vyos.ifconfig import Interface from vyos.ifconfig import Section from vyos.utils.file import read_file diff --git a/src/conf_mode/vrf.py b/src/conf_mode/vrf.py index 6eea9af4d..1b19c55d2 100755 --- a/src/conf_mode/vrf.py +++ b/src/conf_mode/vrf.py @@ -20,7 +20,6 @@ from json import loads from vyos.config import Config from vyos.configdict import get_frrender_dict -from vyos.configdict import dict_merge from vyos.configdict import node_changed from vyos.configverify import verify_route_map from vyos.firewall import conntrack_required @@ -135,16 +134,6 @@ def get_config(config=None): # We need to merge the FRR rendering dict into the VRF dict # this is required to get the route-map information to FRR vrf.update({'frr_dict' : get_frrender_dict(conf)}) - - # We also need the route-map information from the config - # - # XXX: one MUST always call this without the key_mangling() option! See - # vyos.configverify.verify_common_route_maps() for more information. - tmp = {'policy' : {'route-map' : conf.get_config_dict(['policy', 'route-map'], - get_first_key=True)}} - - # Merge policy dict into "regular" config dict - vrf = dict_merge(tmp, vrf) return vrf def verify(vrf): @@ -194,13 +183,13 @@ def verify(vrf): if tmp != None: for protocol, protocol_options in tmp.items(): if 'route_map' in protocol_options: - verify_route_map(protocol_options['route_map'], vrf) + verify_route_map(protocol_options['route_map'], vrf['frr_dict']) tmp = dict_search('ipv6.protocol', vrf_config) if tmp != None: for protocol, protocol_options in tmp.items(): if 'route_map' in protocol_options: - verify_route_map(protocol_options['route_map'], vrf) + verify_route_map(protocol_options['route_map'], vrf['frr_dict']) return None -- cgit v1.2.3