diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-08-21 13:41:20 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-08-21 21:48:58 +0200 |
commit | ddff5eba85feea2a8d6d24e1914ce6d51ce2ea74 (patch) | |
tree | 2e65d8f6e85dc2ba94652b8c0117b3e21e52a609 | |
parent | 081e0334c00887c373fafde761cca960667be21b (diff) | |
download | vyos-1x-ddff5eba85feea2a8d6d24e1914ce6d51ce2ea74.tar.gz vyos-1x-ddff5eba85feea2a8d6d24e1914ce6d51ce2ea74.zip |
vyos.configverify: use build-in functions for verify_interface_exists()
-rw-r--r-- | python/vyos/configverify.py | 4 |
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): |