From 0e1ec63e513a86824cfdfd51da0dfa59ff0c9657 Mon Sep 17 00:00:00 2001 From: sarthurdev <965089+sarthurdev@users.noreply.github.com> Date: Sun, 27 Aug 2023 01:37:17 +0200 Subject: qos: T5018: Fix dependents only being set for QoS interfaces --- src/conf_mode/qos.py | 21 ++++++++++----------- 1 file 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__': -- cgit v1.2.3