chore(lint): apply the 3.1 f-string wave to the kernel-datapath code

The rebase onto 65c858d45 brought upstream's UP032 enforcement; the
conflict resolution kept this branch's semantics on the overlapping
lines, so their .format() calls needed the conversion afterwards
(ruff check --fix, 41 sites) plus the formatter's rewrap (7 files).

Replicates the CI recipe locally: pip check, ruff check/format, mypy
2.3.1 (clean, 434 files), unit suite 2216 passed.
This commit is contained in:
YueGuobin committed 2026-10-06 00:28:06 +08:00
1 parent 5841138cef
commit 87ca2138e3
9 files changed
+49 -158

No files matched your search

+4 -14
View File
@@ -1815,11 +1815,9 @@ class DockerVM(DockerKernelDatapathMixin, BaseNode):
# rejected earlier): the kernel path needs an anchor — the
# veth host end, or the persistent TAP of an IOL runner.
raise DockerError(
"Adapter {adapter_number} port {port_number} of container '{name}' has no host-side "
f"Adapter {adapter_number} port {port_number} of container '{self.name}' has no host-side "
"anchor interface (it was started before the unified-veth datapath); "
"restart the node to attach a kernel link to it".format(
adapter_number=adapter_number, port_number=port_number, name=self.name
)
"restart the node to attach a kernel link to it"
)
# The mechanics (bridge create/addif, capture, markers, filters)
# live in KernelDatapathMixin, shared with every other node type
@@ -1845,11 +1843,7 @@ class DockerVM(DockerKernelDatapathMixin, BaseNode):
# NIO sets it back down).
await self._ubridge_send(f'link set "{host_ifc}" up')
await self._ubridge_send(f'bridge add_nio_ethernet {bridge_name} "{host_ifc}"')
await self._ubridge_send(
"bridge add_nio_udp {bridge_name} {lport} {rhost} {rport}".format(
bridge_name=bridge_name, lport=nio.lport, rhost=nio.rhost, rport=nio.rport
)
)
await self._ubridge_send(f"bridge add_nio_udp {bridge_name} {nio.lport} {nio.rhost} {nio.rport}")
if nio.capturing:
await self._ubridge_send(f'bridge start_capture {bridge_name} "{nio.pcap_output_file}"')
await self._ubridge_send(f"bridge start {bridge_name}")
@@ -1934,11 +1928,7 @@ class DockerVM(DockerKernelDatapathMixin, BaseNode):
if self.status == "started":
await self._set_adapter_carrier(adapter_number, False, port_number)
await self._ubridge_send(f"bridge stop {bridge_name}")
await self._ubridge_send(
"bridge remove_nio_udp {bridge_name} {lport} {rhost} {rport}".format(
bridge_name=bridge_name, lport=nio.lport, rhost=nio.rhost, rport=nio.rport
)
)
await self._ubridge_send(f"bridge remove_nio_udp {bridge_name} {nio.lport} {nio.rhost} {nio.rport}")
adapter.remove_nio(port_number)