clan config: print command in more instances
All checks were successful
checks / test (pull_request) Successful in 23s
checks-impure / test (pull_request) Successful in 9s

This commit is contained in:
Jörg Thalheim 2023-09-26 14:10:52 +02:00
parent 29a48725ef
commit f85fdf678d

View File

@ -107,12 +107,12 @@ def options_for_machine(machine_name: str, show_trace: bool = False) -> dict:
cmd = nix_eval(flags=flags)
proc = subprocess.run(
cmd,
capture_output=True,
stdout=subprocess.PIPE,
text=True,
)
if proc.returncode != 0:
raise Exception(
f"Failed to read options for machine {machine_name}:\n{shlex.join(cmd)} returned:\n{proc.stderr}"
raise ClanError(
f"Failed to read options for machine {machine_name}:\n{shlex.join(cmd)}\nexit with {proc.returncode}"
)
return json.loads(proc.stdout)