Merge pull request 'clan config: print command in more instances' (#342) from Mic92-docs into main
All checks were successful
checks-impure / test (push) Successful in 8s
checks / test (push) Successful in 1m17s
assets1 / test (push) Successful in 6s

This commit is contained in:
clan-bot 2023-09-26 12:13:09 +00:00
commit 677494811b

View File

@ -118,12 +118,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)