summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-08-27 07:05:18 +0200
committerGitHub <noreply@github.com>2023-08-27 07:05:18 +0200
commitf7b7c6df9822e435f5c03093cfdc0f94bf366290 (patch)
tree3223aedf2eaab277c3365a2215a19eed8087e60c /src
parent75aa90cf2b234a34565d165697196ac9a304bb66 (diff)
parent0e1ec63e513a86824cfdfd51da0dfa59ff0c9657 (diff)
downloadvyos-1x-f7b7c6df9822e435f5c03093cfdc0f94bf366290.tar.gz
vyos-1x-f7b7c6df9822e435f5c03093cfdc0f94bf366290.zip
Merge pull request #2174 from sarthurdev/T5018_fix
qos: T5018: Fix dependents only being set for QoS interfaces
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/qos.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/src/conf_mode/qos.py b/src/conf_mode/qos.py
index 5536adda2..ad4121a49 100755
--- a/src/conf_mode/qos.py
+++ b/src/conf_mode/qos.py
@@ -84,17 +84,16 @@ def get_config(config=None):
get_first_key=True,
no_tag_node_value_mangle=True)
- if 'interface' in qos:
- for ifname, if_conf in qos['interface'].items():
- if_node = Section.get_config_path(ifname)
+ for ifname in interfaces():
+ if_node = Section.get_config_path(ifname)
- if not if_node:
- continue
+ if not if_node:
+ continue
- path = f'interfaces {if_node}'
- if conf.exists(f'{path} mirror') or conf.exists(f'{path} redirect'):
- type_node = path.split(" ")[1] # return only interface type node
- set_dependents(type_node, conf, ifname)
+ path = f'interfaces {if_node}'
+ if conf.exists(f'{path} mirror') or conf.exists(f'{path} redirect'):
+ type_node = path.split(" ")[1] # return only interface type node
+ set_dependents(type_node, conf, ifname.split(".")[0])
for policy in qos.get('policy', []):
if policy in ['random_detect']:
@@ -209,6 +208,8 @@ def apply(qos):
call(f'tc qdisc del dev {interface} parent ffff:')
call(f'tc qdisc del dev {interface} root')
+ call_dependents()
+
if not qos or 'interface' not in qos:
return None
@@ -229,8 +230,6 @@ def apply(qos):
tmp = shaper_type(interface)
tmp.update(shaper_config, direction)
- call_dependents()
-
return None
if __name__ == '__main__':