From fa391feabeec1dfb52fee79d4635b4646ccc9559 Mon Sep 17 00:00:00 2001 From: K900 Date: Fri, 23 Oct 2026 11:41:27 +0300 Subject: [PATCH] lib/test-driver: also add machine name to the other errors --- nixos/lib/test-driver/src/test_driver/machine/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/nixos/lib/test-driver/src/test_driver/machine/__init__.py b/nixos/lib/test-driver/src/test_driver/machine/__init__.py index 5c4e241dc7ac..4acede7f86da 100644 --- a/nixos/lib/test-driver/src/test_driver/machine/__init__.py +++ b/nixos/lib/test-driver/src/test_driver/machine/__init__.py @@ -742,7 +742,7 @@ class BaseMachine(ABC): ) if ret.returncode != 0: raise MachineError( - f"Cannot convert screenshot (pnmtopng returned code {ret.returncode})" + f"{self.name}: Cannot convert screenshot (pnmtopng returned code {ret.returncode})" ) def get_screen_text_variants(self) -> list[str]: @@ -1802,7 +1802,7 @@ class NspawnMachine(BaseMachine): ret = subprocess.run(["xwdtopnm", xwd_path], stdout=ppm) if ret.returncode != 0: raise MachineError( - f"Cannot convert screenshot (xwdtopnm returned code {ret.returncode})" + f"{self.name}: Cannot convert screenshot (xwdtopnm returned code {ret.returncode})" ) yield ppm_path @@ -1901,7 +1901,9 @@ class NspawnMachine(BaseMachine): # Poll the socket until we have the container leader PID while True: if self.process.poll() is not None: - raise MachineError("systemd-nspawn process exited unexpectedly") + raise MachineError( + f"{self.name}: systemd-nspawn process exited unexpectedly" + ) with self._notify_lock: is_ready = self._notify_ready