diff options
author | Christian Breunig <christian@breunig.cc> | 2024-04-03 00:01:13 +0200 |
---|---|---|
committer | Christian Breunig <christian@breunig.cc> | 2024-04-03 21:01:50 +0200 |
commit | 86f793fcb2c6be880819a572cc7982861ca38314 (patch) | |
tree | bd87b2fc0c17921adba331b4ebe7b5f4ce1c6983 /src/conf_mode/qos.py | |
parent | 9305f615e55c68efb2d9c5feb65bc716efa6c20d (diff) | |
download | vyos-1x-86f793fcb2c6be880819a572cc7982861ca38314.tar.gz vyos-1x-86f793fcb2c6be880819a572cc7982861ca38314.zip |
T6199: replace netifaces.interfaces() with common custom helpers
* Use interface_exists() outside of verify()
* Use verify_interface_exists() in verify() to drop common error message
(cherry picked from commit 4c7c168fe970b807750a05ceb66b70c0d8652535)
Diffstat (limited to 'src/conf_mode/qos.py')
-rwxr-xr-x | src/conf_mode/qos.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/conf_mode/qos.py b/src/conf_mode/qos.py index 2b4fcc1bf..818f9a7ac 100755 --- a/src/conf_mode/qos.py +++ b/src/conf_mode/qos.py @@ -23,6 +23,7 @@ from vyos.base import Warning from vyos.config import Config from vyos.configdep import set_dependents, call_dependents from vyos.configdict import dict_merge +from vyos.configverify import verify_interface_exists from vyos.ifconfig import Section from vyos.qos import CAKE from vyos.qos import DropTail @@ -37,7 +38,6 @@ from vyos.qos import RoundRobin from vyos.qos import TrafficShaper from vyos.qos import TrafficShaperHFSC 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 @@ -215,11 +215,10 @@ def apply(qos): return None for interface, interface_config in qos['interface'].items(): - if not interface_exists(interface): + if not verify_interface_exists(interface, warning_only=True): # 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 - Warning(f'Interface "{interface}" does not exist!') + # Skip the configuration and inform the user via warning_only=True continue for direction in ['egress', 'ingress']: |