summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-07-20 11:26:35 +0200
committerChristian Breunig <christian@breunig.cc>2024-07-20 20:21:07 +0200
commit0df7599464f5f9a71daac62bc73284fd61948dbb (patch)
tree853a175d831fc5f8658f4015d163f3e6b36b23f3 /src
parent031eebc1ee473196cffe9e4b7b0164444cf88905 (diff)
downloadvyos-1x-0df7599464f5f9a71daac62bc73284fd61948dbb.tar.gz
vyos-1x-0df7599464f5f9a71daac62bc73284fd61948dbb.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