Fix the rest of 'Formatting a regular string which could be an f-string'

Some fixes have to be done manually.

(cherry picked from commit a384283497)
This commit is contained in:
Štěpán Balážik 2026-01-28 00:47:24 +01:00
parent eb9a93ebd5
commit a8911683d7
4 changed files with 14 additions and 10 deletions

View file

@ -68,7 +68,7 @@ def test_rndc_deadlock(ns3):
# Create 4 worker threads running "rndc" commands in a loop.
with concurrent.futures.ThreadPoolExecutor() as executor:
for i in range(1, 5):
domain = "example%d" % i
domain = f"example{i}"
executor.submit(rndc_loop, test_state, domain, ns3)
# Run "rndc status" 10 times, with 1-second pauses between attempts.

View file

@ -48,7 +48,7 @@ def test_gnutls_cli_query(gnutls_cli_executable, named_tlsport):
"--no-ocsp",
"--alpn=dot",
"--logfile=gnutls-cli.log",
"--port=%d" % named_tlsport,
f"--port={named_tlsport}",
"10.53.0.1",
]
with open("gnutls-cli.err", "wb") as gnutls_cli_stderr, subprocess.Popen(

View file

@ -58,7 +58,7 @@ def open_connections(active_conns, count, host, port):
except socket.error:
family = socket.AF_INET6
log("Opening %d connections..." % count)
log(f"Opening {count} connections...")
for _ in range(count):
sock = socket.socket(family, socket.SOCK_STREAM)
@ -88,23 +88,23 @@ def open_connections(active_conns, count, host, port):
active_conns.append(sock)
if errors:
log("result=FAIL: %d connection(s) failed" % len(errors))
log(f"result=FAIL: {len(errors)} connection(s) failed")
elif queued:
log("result=FAIL: Timed out, aborting %d pending connections" % len(queued))
log(f"result=FAIL: Timed out, aborting {len(queued)} pending connections")
for sock in queued:
sock.close()
else:
log("result=OK: Successfully opened %d connections" % count)
log(f"result=OK: Successfully opened {count} connections")
def close_connections(active_conns, count):
log("Closing {} connections...".format("all") if count == 0 else str(count))
log(f"Closing {'all' if count == 0 else count} connections...")
if count == 0:
count = len(active_conns)
for _ in range(count):
sock = active_conns.pop(0)
sock.close()
log("result=OK: Successfully closed %d connections" % count)
log(f"result=OK: Successfully closed {count} connections")
def sigterm(*_):
@ -127,7 +127,7 @@ def main():
except KeyError:
port = 5309
log("Listening on %s:%d" % (listenip, port))
log(f"Listening on {listenip}:{port}")
ctlsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
ctlsock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

View file

@ -16,7 +16,6 @@ deprecated-modules = [
[tool.pylint.messages_control]
disable = [
"C0103", # invalid-name
"C0209", # consider-using-f-string
"C0114", # missing-module-docstring
"C0115", # missing-class-docstring
"C0116", # missing-function-docstring
@ -74,6 +73,11 @@ ignore_names = [
[tool.ruff]
target-version = "py310"
lint.select = [
# f-strings
"UP031",
"UP032",
]
extend-exclude = [
"bin/tests/system/vulture_ignore_list.py",
"contrib",