summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-12-11 21:35:54 +0100
committerChristian Breunig <christian@breunig.cc>2024-12-16 22:24:50 +0100
commit4d0774e534766d70961975933635e6c54dcc1982 (patch)
tree91d055721c998d27f425e60519ba5ca9014725e7
parent147751ec59527800e956b7ea689805ba80769abe (diff)
downloadvyos-1x-4d0774e534766d70961975933635e6c54dcc1982.tar.gz
vyos-1x-4d0774e534766d70961975933635e6c54dcc1982.zip
vrf: T6746: bugfix change of VNI
VNI was always retrieved via effective configuration and not active configuration.
-rw-r--r--python/vyos/configdict.py4
-rwxr-xr-xsmoketest/scripts/cli/test_vrf.py2
-rwxr-xr-xsrc/conf_mode/vrf.py15
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