summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-07-20 11:26:35 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-07-20 14:21:20 +0000
commit44e5a11979fd1eb6854603f5bc674bec50cc5dcc (patch)
tree2601126049b50bd5a33c5959be7f4bf022159b70 /src
parent1b3350788ceeace52e2d693a18d92d82464220c0 (diff)
downloadvyos-1x-44e5a11979fd1eb6854603f5bc674bec50cc5dcc.tar.gz
vyos-1x-44e5a11979fd1eb6854603f5bc674bec50cc5dcc.zip
utils: migrate to new get_vrf_tableid() helper
Commit 452068ce7 ("interfaces: T6592: moving an interface between VRF instances failed") introduced a new helper to retrieve the VRF table ID from the Kernel. This commit migrates the old code path where the individual fields got queried to the new helper vyos.utils.network.get_vrf_tableid(). (cherry picked from commit 36f3791e0c15267483d59a3bb74465811d08df88)
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/vrf.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/vrf.py b/src/conf_mode/vrf.py
index 8d8c234c0..12edb7d02 100755
--- a/src/conf_mode/vrf.py
+++ b/src/conf_mode/vrf.py
@@ -27,6 +27,7 @@ from vyos.template import render
from vyos.template import render_to_string
from vyos.utils.dict import dict_search
from vyos.utils.network import get_interface_config
+from vyos.utils.network import get_vrf_tableid
from vyos.utils.network import get_vrf_members
from vyos.utils.network import interface_exists
from vyos.utils.process import call
@@ -160,8 +161,8 @@ def verify(vrf):
# routing table id can't be changed - OS restriction
if interface_exists(name):
- tmp = str(dict_search('linkinfo.info_data.table', get_interface_config(name)))
- if tmp and tmp != vrf_config['table']:
+ tmp = get_vrf_tableid(name)
+ if tmp and tmp != int(vrf_config['table']):
raise ConfigError(f'VRF "{name}" table id modification not possible!')
# VRF routing table ID must be unique on the system