diff options
author | Christian Poessinger <christian@poessinger.com> | 2021-08-21 13:41:20 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2021-08-22 09:56:41 +0200 |
commit | bebe2ede796a65bbd926d2dca32abe551deb0445 (patch) | |
tree | c67189d78c33c3ca4c39c269a899b89a369f6e00 | |
parent | d832973d0db901ca9ce6b42b3b8eb527208926c3 (diff) | |
download | vyos-1x-bebe2ede796a65bbd926d2dca32abe551deb0445.tar.gz vyos-1x-bebe2ede796a65bbd926d2dca32abe551deb0445.zip |
vyos.configverify: use build-in functions for verify_interface_exists()
(cherry picked from commit ddff5eba85feea2a8d6d24e1914ce6d51ce2ea74)
-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 0b6e6fc13..524eb6fd7 100644 --- a/python/vyos/configverify.py +++ b/python/vyos/configverify.py @@ -208,8 +208,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): |