diff options
author | Christian Breunig <christian@breunig.cc> | 2024-04-26 20:33:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-26 20:33:59 +0200 |
commit | f980f8b8010a9681c387d47c476254c89b0c4a25 (patch) | |
tree | 0aba005506ce4384722ae67f9202f2b0d497bd98 /python/vyos/qos | |
parent | 854864f0dffe3d3371bb05eaaf6c470ba16598dd (diff) | |
parent | 8c5c3bc48f76a5bb0c819c6f549d7fbcacf964de (diff) | |
download | vyos-1x-f980f8b8010a9681c387d47c476254c89b0c4a25.tar.gz vyos-1x-f980f8b8010a9681c387d47c476254c89b0c4a25.zip |
Merge pull request #3365 from vyos/mergify/bp/sagitta/pr-3316
qos: T4248: Allow to remove the only rule from the qos class (backport #3316)
Diffstat (limited to 'python/vyos/qos')
-rw-r--r-- | python/vyos/qos/base.py | 5 |
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' |