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 00:01:13 +0200
commit4c7c168fe970b807750a05ceb66b70c0d8652535 (patch)
tree945345f3f465d9647d10f7fde742756d2c77e435 /python/vyos/configverify.py
parent86b632874288aa5707a94a4f28ca816e543823b9 (diff)
downloadvyos-1x-4c7c168fe970b807750a05ceb66b70c0d8652535.tar.gz
vyos-1x-4c7c168fe970b807750a05ceb66b70c0d8652535.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
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: