summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2023-08-27 01:37:17 +0200
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2023-08-27 01:53:41 +0200
commit0e1ec63e513a86824cfdfd51da0dfa59ff0c9657 (patch)
tree3223aedf2eaab277c3365a2215a19eed8087e60c
parent75aa90cf2b234a34565d165697196ac9a304bb66 (diff)
downloadvyos-1x-0e1ec63e513a86824cfdfd51da0dfa59ff0c9657.tar.gz
vyos-1x-0e1ec63e513a86824cfdfd51da0dfa59ff0c9657.zip
qos: T5018: Fix dependents only being set for QoS interfaces
-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__':