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
1f6859de08
commit
3b873d91fe
27 files changed
+195
-225
No files matched your search
@@ -14,7 +14,6 @@ from typing import Any
|
||||
|
||||
from netaddr import EUI, AddrFormatError
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# MAC address helpers
|
||||
# ---------------------------------------------------------------------------
|
||||
@@ -47,6 +46,7 @@ def normalize_mac(mac: str) -> str:
|
||||
# IP / prefix helpers
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def prefix_length(cidr: str) -> int:
|
||||
"""Return prefix length from a CIDR string such as '192.168.1.0/24' → 24."""
|
||||
try:
|
||||
@@ -141,6 +141,7 @@ def speed_mbps(iface_data: dict[str, Any]) -> float:
|
||||
# ARP / neighbour table helpers
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def parse_arp_output(raw: str) -> list[dict[str, Any]]:
|
||||
"""Parse Linux ``arp -n`` text output into NAPALM ARP dicts.
|
||||
|
||||
@@ -202,6 +203,7 @@ def sdn_zone_to_network_instance(zone: dict[str, Any]) -> dict[str, Any]:
|
||||
# OVS helpers
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
def parse_ovs_vsctl_show(raw: str) -> dict[str, Any]:
|
||||
"""Very lightweight parser for ``ovs-vsctl show`` output.
|
||||
|
||||
|
||||
Reference in new issue
Block a user