Watch
0
0
Fork
You've already forked hyperhive
0

full-setup: diagnose() prints the failed units and the journal tail only

On a timed-out wait, diagnose() prints systemctl --failed for the machine
or container and the last 50 journal lines of the units waited on. It no
longer prints `systemctl status` for them. Only the failure path changes.
This commit is contained in:
atlas 2026-11-10 00:56:23 +01:00 • committed by mara
commit a2cd4f3da8

View file

@ -206,14 +206,13 @@ pkgs.testers.runNixOSTest (
)
def diagnose(unit=None, container=None):
# What a timed-out wait leaves behind: the failed units, and the status
# and the end of the journal of the unit that was waited on.
# What a timed-out wait leaves behind: the failed units and the end of the
# journal of the units that were waited on.
where = f"--machine={container} " if container else ""
units = [unit] if isinstance(unit, str) else list(unit or [])
flags = " ".join(f"-u '{u}'" for u in units)
for command in [
f"systemctl {where}--failed --no-legend --no-pager",
*([f"systemctl {where}status --no-pager -n 0 -l {' '.join(units)} | head -c 4000"] if units else []),
*([f"journalctl {where}{flags} --no-pager -n 50 | tail -c 6000"] if units else []),
]:
print(f"--- {command}")