summaryrefslogtreecommitdiff
path: root/python/vyos/configverify.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-08-21 13:41:20 +0200
committerChristian Poessinger <christian@poessinger.com>2021-08-21 21:48:58 +0200
commitddff5eba85feea2a8d6d24e1914ce6d51ce2ea74 (patch)
tree2e65d8f6e85dc2ba94652b8c0117b3e21e52a609 /python/vyos/configverify.py
parent081e0334c00887c373fafde761cca960667be21b (diff)
downloadvyos-1x-ddff5eba85feea2a8d6d24e1914ce6d51ce2ea74.tar.gz
vyos-1x-ddff5eba85feea2a8d6d24e1914ce6d51ce2ea74.zip
vyos.configverify: use build-in functions for verify_interface_exists()
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 4279e6982..7f49aa9af 100644
--- a/python/vyos/configverify.py
+++ b/python/vyos/configverify.py
@@ -237,8 +237,8 @@ def verify_interface_exists(ifname):
Common helper function used by interface implementations to perform
recurring validation if an interface actually exists.
"""
- from netifaces import interfaces
- if ifname not in interfaces():
+ import os
+ if not os.path.exists(f'/sys/class/net/{ifname}'):
raise ConfigError(f'Interface "{ifname}" does not exist!')
def verify_source_interface(config):