Skip to content

Commit

Permalink
qos: T5018: Fix dependents only being set for QoS interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthurdev committed Aug 26, 2023
1 parent 75aa90c commit 0e1ec63
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/conf_mode/qos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']:
Expand Down Expand Up @@ -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

Expand All @@ -229,8 +230,6 @@ def apply(qos):
tmp = shaper_type(interface)
tmp.update(shaper_config, direction)

call_dependents()

return None

if __name__ == '__main__':
Expand Down

0 comments on commit 0e1ec63

Please sign in to comment.