diff options
author | Christian Breunig <christian@breunig.cc> | 2024-07-20 11:26:35 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-07-20 11:47:29 +0200 |
commit | 36f3791e0c15267483d59a3bb74465811d08df88 (patch) | |
tree | 6d5ba304a7a0332c8a2426329a3e7f8f61f025fc /src | |
parent | 452068ce78581bb6fba2df4dba197e95b9aeb33d (diff) | |
download | vyos-1x-36f3791e0c15267483d59a3bb74465811d08df88.tar.gz vyos-1x-36f3791e0c15267483d59a3bb74465811d08df88.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().
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/vrf.py | 5 |
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 |