summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2024-04-25 17:31:23 +0200
committerGitHub <noreply@github.com>2024-04-25 17:31:23 +0200
commitb8c5c0c3b74fff00f998a22eae0e3a491af3fa6d (patch)
tree7fa27b7290df32cc6d68e7f2a6993ba6c3eb4278 /python
parent13af058504c67dfabced5c8a1762e04ffde119ce (diff)
parentda40bd2b2a826986de128354ea1bfc041ada0016 (diff)
downloadvyos-1x-b8c5c0c3b74fff00f998a22eae0e3a491af3fa6d.tar.gz
vyos-1x-b8c5c0c3b74fff00f998a22eae0e3a491af3fa6d.zip
Merge pull request #3316 from HollyGurza/T4248
qos: T4248: Allow to remove the only rule from the qos class
Diffstat (limited to 'python')
-rw-r--r--python/vyos/qos/base.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/vyos/qos/base.py b/python/vyos/qos/base.py
index f9366c6b1..4173a1a43 100644
--- a/python/vyos/qos/base.py
+++ b/python/vyos/qos/base.py
@@ -246,6 +246,7 @@ class QoSBase:
filter_cmd_base += ' protocol all'
if 'match' in cls_config:
+ is_filtered = False
for index, (match, match_config) in enumerate(cls_config['match'].items(), start=1):
filter_cmd = filter_cmd_base
if self.qostype == 'shaper' and 'prio ' not in filter_cmd:
@@ -330,11 +331,13 @@ class QoSBase:
cls = int(cls)
filter_cmd += f' flowid {self._parent:x}:{cls:x}'
self._cmd(filter_cmd)
+ is_filtered = True
vlan_expression = "match.*.vif"
match_vlan = jmespath.search(vlan_expression, cls_config)
- if any(tmp in ['exceed', 'bandwidth', 'burst'] for tmp in cls_config):
+ if any(tmp in ['exceed', 'bandwidth', 'burst'] for tmp in cls_config) \
+ and is_filtered:
# For "vif" "basic match" is used instead of "action police" T5961
if not match_vlan:
filter_cmd += f' action police'