diff options
author | Christian Breunig <christian@breunig.cc> | 2024-04-01 20:38:56 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-04-01 20:38:56 +0200 |
commit | 5bb27f0c6220fd940b63cdd37a60c312c0ac3efd (patch) | |
tree | 3908e55564363e97d6d62bcc9dc4ba9dcba82457 /python/vyos/template.py | |
parent | 32d6a693de99021d2cd44fb4235e929caf7b4a6d (diff) | |
download | vyos-1x-5bb27f0c6220fd940b63cdd37a60c312c0ac3efd.tar.gz vyos-1x-5bb27f0c6220fd940b63cdd37a60c312c0ac3efd.zip |
utils: T5738: always use vyos.utils.network.interface_exists over os.path.exists
Diffstat (limited to 'python/vyos/template.py')
-rw-r--r-- | python/vyos/template.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/python/vyos/template.py b/python/vyos/template.py index 1aa9ace8b..3e468eb82 100644 --- a/python/vyos/template.py +++ b/python/vyos/template.py @@ -307,7 +307,8 @@ def network_from_ipv4(address): @register_filter('is_interface') def is_interface(interface): """ Check if parameter is a valid local interface name """ - return os.path.exists(f'/sys/class/net/{interface}') + from vyos.utils.network import interface_exists + return interface_exists(interface) @register_filter('is_ip') def is_ip(addr): |