diff options
-rw-r--r-- | .github/workflows/pull-request-labels.yml | 5 | ||||
-rwxr-xr-x | src/conf_mode/qos.py | 21 |
2 files changed, 14 insertions, 12 deletions
diff --git a/.github/workflows/pull-request-labels.yml b/.github/workflows/pull-request-labels.yml index 629a54a49..778daae30 100644 --- a/.github/workflows/pull-request-labels.yml +++ b/.github/workflows/pull-request-labels.yml @@ -2,7 +2,7 @@ name: Add pull request labels on: - pull_request: + pull_request_target: branches: - current - crux @@ -13,5 +13,8 @@ jobs: add-pr-label: name: Add PR Labels runs-on: ubuntu-20.04 + permissions: + contents: read + pull-requests: write steps: - uses: actions/labeler@v5.0.0-alpha.1 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__': |