summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-07-30 08:07:29 +0200
committerChristian Breunig <christian@breunig.cc>2024-07-30 08:07:29 +0200
commit9b99a01653e3315b1abc9ef98824ca71bd283047 (patch)
tree5228b3ef3c66fd6fa78678d71b5b4ef1d8c7dde3 /python/vyos
parentadeac78ed6585b16102bd82581b54c75819714b2 (diff)
downloadvyos-1x-9b99a01653e3315b1abc9ef98824ca71bd283047.tar.gz
vyos-1x-9b99a01653e3315b1abc9ef98824ca71bd283047.zip
pbr: T6430: refactor to use vyos.utils.network.get_vrf_tableid()
Commit 452068ce78 ("interfaces: T6592: moving an interface between VRF instances failed") added a similar but more detailed implementation of get_vrf_table_id() that was added in commit adeac78ed of this PR. Move to the common available implementation.
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/firewall.py6
-rw-r--r--python/vyos/utils/network.py3
2 files changed, 3 insertions, 6 deletions
diff --git a/python/vyos/firewall.py b/python/vyos/firewall.py
index 89cd68183..facd498ca 100644
--- a/python/vyos/firewall.py
+++ b/python/vyos/firewall.py
@@ -30,7 +30,7 @@ from vyos.utils.dict import dict_search_args
from vyos.utils.dict import dict_search_recursive
from vyos.utils.process import cmd
from vyos.utils.process import run
-from vyos.utils.network import get_vrf_table_id
+from vyos.utils.network import get_vrf_tableid
from vyos.defaults import rt_global_table
from vyos.defaults import rt_global_vrf
@@ -482,8 +482,8 @@ def parse_rule(rule_conf, hook, fw_name, rule_id, ip_name):
if vrf_name == 'default':
table = rt_global_vrf
else:
- # NOTE: VRF->table ID lookup depends on the VRF iface already existing.
- table = get_vrf_table_id(vrf_name)
+ # NOTE: VRF->table ID lookup depends on the VRF iface already existing.
+ table = get_vrf_tableid(vrf_name)
if 'table' in rule_conf['set']:
set_table = True
table = rule_conf['set']['table']
diff --git a/python/vyos/utils/network.py b/python/vyos/utils/network.py
index d297a1ddb..8fce08de0 100644
--- a/python/vyos/utils/network.py
+++ b/python/vyos/utils/network.py
@@ -74,9 +74,6 @@ def get_vrf_members(vrf: str) -> list:
pass
return interfaces
-def get_vrf_table_id(vrf: str):
- return get_interface_config(vrf)['linkinfo']['info_data']['table']
-
def get_interface_vrf(interface):
""" Returns VRF of given interface """
from vyos.utils.dict import dict_search