summaryrefslogtreecommitdiff
path: root/python/vyos/configverify.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-04-03 00:01:13 +0200
committerChristian Breunig <christian@breunig.cc>2024-04-03 21:01:50 +0200
commit86f793fcb2c6be880819a572cc7982861ca38314 (patch)
treebd87b2fc0c17921adba331b4ebe7b5f4ce1c6983 /python/vyos/configverify.py
parent9305f615e55c68efb2d9c5feb65bc716efa6c20d (diff)
downloadvyos-1x-86f793fcb2c6be880819a572cc7982861ca38314.tar.gz
vyos-1x-86f793fcb2c6be880819a572cc7982861ca38314.zip
T6199: replace netifaces.interfaces() with common custom helpers
* Use interface_exists() outside of verify() * Use verify_interface_exists() in verify() to drop common error message (cherry picked from commit 4c7c168fe970b807750a05ceb66b70c0d8652535)
Diffstat (limited to 'python/vyos/configverify.py')
-rw-r--r--python/vyos/configverify.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/python/vyos/configverify.py b/python/vyos/configverify.py
index 300647d21..55978ec9d 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -275,7 +275,7 @@ def verify_source_interface(config):
required by e.g. peth/MACvlan, MACsec ...
"""
import re
- from netifaces import interfaces
+ from vyos.utils.network import interface_exists
ifname = config['ifname']
if 'source_interface' not in config:
@@ -287,7 +287,7 @@ def verify_source_interface(config):
if tmp.match(src_ifname):
raise ConfigError(f'Can not source "{ifname}" from dynamic interface "{src_ifname}"!')
- if src_ifname not in interfaces():
+ if not interface_exists(src_ifname):
raise ConfigError(f'Specified source-interface {src_ifname} does not exist')
if 'source_interface_is_bridge_member' in config: