summaryrefslogtreecommitdiff
path: root/src/conf_mode/qos.py
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-04-01 20:38:56 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-04-02 16:33:59 +0000
commitb3fb51cd799d231d16425faa1495bc6b9188d814 (patch)
tree2c16e8b4d441308462f18644efa6d0270ff826c2 /src/conf_mode/qos.py
parent9f831714ef0f32264e7046a5ecb86d74f24ec4ac (diff)
downloadvyos-1x-b3fb51cd799d231d16425faa1495bc6b9188d814.tar.gz
vyos-1x-b3fb51cd799d231d16425faa1495bc6b9188d814.zip
utils: T5738: always use vyos.utils.network.interface_exists over os.path.exists
(cherry picked from commit 5bb27f0c6220fd940b63cdd37a60c312c0ac3efd)
Diffstat (limited to 'src/conf_mode/qos.py')
-rwxr-xr-xsrc/conf_mode/qos.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/qos.py b/src/conf_mode/qos.py
index 4a0b4d0c5..2b4fcc1bf 100755
--- a/src/conf_mode/qos.py
+++ b/src/conf_mode/qos.py
@@ -36,8 +36,9 @@ from vyos.qos import RateLimiter
from vyos.qos import RoundRobin
from vyos.qos import TrafficShaper
from vyos.qos import TrafficShaperHFSC
-from vyos.utils.process import run
from vyos.utils.dict import dict_search_recursive
+from vyos.utils.network import interface_exists
+from vyos.utils.process import run
from vyos import ConfigError
from vyos import airbag
airbag.enable()
@@ -214,7 +215,7 @@ def apply(qos):
return None
for interface, interface_config in qos['interface'].items():
- if not os.path.exists(f'/sys/class/net/{interface}'):
+ if not interface_exists(interface):
# When shaper is bound to a dialup (e.g. PPPoE) interface it is
# possible that it is yet not availbale when to QoS code runs.
# Skip the configuration and inform the user