style: ruff format and the lint rules of the driver standard
Mechanical: ruff format, and ruff check --fix with the rule set every NAPALM driver uses (E, F, I, UP, B at line length 100, Python 3.10). What ruff cannot fix comes in the next commit.
This commit is contained in:
1 parent
7f2ae6ac58
commit
a212bc8715
14 files changed
+322
-239
No files matched your search
@@ -1,4 +1,3 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
@@ -172,7 +171,7 @@ class OpenWrtVLANMixin:
|
||||
vm = re.match(r"^([\w-]+)\.(\d+)$", iface) # allow hyphens (br-ap)
|
||||
if not vm:
|
||||
continue
|
||||
parent = vm.group(1) # e.g. "eth0" or "br-ap"
|
||||
parent = vm.group(1) # e.g. "eth0" or "br-ap"
|
||||
vlan_id = str(int(vm.group(2))) # e.g. "10"
|
||||
vlans.setdefault(vlan_id, {"name": "", "tagged": [], "untagged": []})
|
||||
# sub-interface itself -> untagged egress
|
||||
@@ -210,11 +209,13 @@ class OpenWrtVLANMixin:
|
||||
# No explicit bridge-vlan section -- nothing to delete via UCI
|
||||
return
|
||||
|
||||
self.cli([
|
||||
f"uci delete network.@bridge-vlan[{idx}]",
|
||||
"uci commit network",
|
||||
"/etc/init.d/network reload",
|
||||
])
|
||||
self.cli(
|
||||
[
|
||||
f"uci delete network.@bridge-vlan[{idx}]",
|
||||
"uci commit network",
|
||||
"/etc/init.d/network reload",
|
||||
]
|
||||
)
|
||||
|
||||
def get_network_instances(self, name: str = "") -> dict[str, Any]:
|
||||
"""Return network instances (Linux network namespaces + default).
|
||||
|
||||
Reference in new issue
Block a user