Fix python linter errors

This commit is contained in:
pinpox
2025-10-20 15:47:51 +02:00
parent 0ea561f998
commit ae5712229c
7 changed files with 27 additions and 15 deletions

View File

@@ -1,17 +1,29 @@
diff --git a/src/main.rs b/src/main.rs
index 8baf5924a7db..1234567890ab 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1295,6 +1295,12 @@ won't take effect until you reboot the system.
From 46ec73cdeac58807a49b738c44d2e8d5dfbc5fc8 Mon Sep 17 00:00:00 2001
From: pinpox <git@pablo.tools>
Date: Mon, 20 Oct 2025 16:30:22 +0200
Subject: [PATCH] patch switch-to-configuration-ng for container tests
---
pkgs/by-name/sw/switch-to-configuration-ng/src/src/main.rs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pkgs/by-name/sw/switch-to-configuration-ng/src/src/main.rs b/pkgs/by-name/sw/switch-to-configuration-ng/src/src/main.rs
index f4d339ccf60e..c50863e15e32 100644
--- a/pkgs/by-name/sw/switch-to-configuration-ng/src/src/main.rs
+++ b/pkgs/by-name/sw/switch-to-configuration-ng/src/src/main.rs
@@ -1320,6 +1320,12 @@ won't take effect until you reboot the system.
for (mountpoint, current_filesystem) in current_filesystems {
// Use current version of systemctl binary before daemon is reexeced.
+
+
+ // Skip filesystem comparison if x-initrd.mount is present in options
+ if current_filesystem.options.contains("x-initrd.mount") {
+ continue;
+ }
+
+
let unit = path_to_unit_name(&current_system_bin, &mountpoint);
if let Some(new_filesystem) = new_filesystems.get(&mountpoint) {
if current_filesystem.fs_type != new_filesystem.fs_type
if current_filesystem.fs_type != new_filesystem.fs_type
--
2.51.0

View File

@@ -501,7 +501,7 @@ def setup_filesystems(container: ContainerInfo) -> None:
if file.is_symlink():
target = file.readlink()
sym = container.nix_store_dir / file.name
os.symlink(target, sym)
sym.symlink_to(target)
# Read /proc/mounts and replicate every bind mount
with Path("/proc/self/mounts").open() as f:

View File

@@ -94,7 +94,7 @@ class TestHttpBridge:
def test_http_bridge_middleware_setup(self, http_bridge: tuple) -> None:
"""Test that middleware is properly set up."""
api, middleware_chain = http_bridge
_api, middleware_chain = http_bridge
# Test that we can create the bridge with middleware
# The actual HTTP handling will be tested through the server integration tests

View File

@@ -144,7 +144,7 @@ def test_machine_delete(
) -> None:
flake = flake_with_sops
admin_key, machine_key, machine2_key, *xs = sops_setup.keys
admin_key, machine_key, machine2_key, *_xs = sops_setup.keys
# create a couple machines with their keys
for name, key in (("my-machine", machine_key), ("my-machine2", machine2_key)):

View File

@@ -1418,7 +1418,7 @@ def test_shared_generator_conflicting_definition_raises_error(
# because they have conflicting definitions for the same shared generator
with pytest.raises(
ClanError,
match=".*differ.*",
match=r".*differ.*",
):
cli.run(["vars", "generate", "--flake", str(flake.path)])

View File

@@ -790,7 +790,7 @@ class TestGetLlmFinalDecision:
):
mock_agg.return_value = MagicMock(tools=[mock_schema])
function_call_results, message = get_llm_final_decision(
function_call_results, _message = get_llm_final_decision(
user_request="okay then gchq-local as controller and qube-email as moon please everything else as peer",
flake=mock_flake,
selected_service="zerotier",

View File

@@ -216,7 +216,7 @@ class TestLogFileCreation:
configured_log_manager: LogManager,
) -> None:
"""Test that creating log file with unregistered group fails."""
with pytest.raises(ValueError, match="Group structure.*is not valid"):
with pytest.raises(ValueError, match=r"Group structure.*is not valid"):
configured_log_manager.create_log_file(
example_function,
"test_op",
@@ -228,7 +228,7 @@ class TestLogFileCreation:
configured_log_manager: LogManager,
) -> None:
"""Test that invalid nested structure fails."""
with pytest.raises(ValueError, match="Group structure.*is not valid"):
with pytest.raises(ValueError, match=r"Group structure.*is not valid"):
configured_log_manager.create_log_file(
example_function,
"test_op",