container: Report tool installer failures without a traceback

A failing official installer aborted with a raw CalledProcessError
traceback, burying the actual problem the installer had already printed
to the terminal. Exit with a short message pointing at that output
instead.
This commit is contained in:
Jeena 2026-09-24 06:54:11 +09:00
parent 1fd877bdae
commit cc5c2b14a8

View file

@ -243,13 +243,20 @@ class AgentContainer:
f"Installing {tool} into the container home " f"Installing {tool} into the container home "
"(official installer, no sudo)..." "(official installer, no sudo)..."
) )
subprocess.run( try:
[ subprocess.run(
"docker", "exec", self.container_name, "bash", "-lc", [
spec["install"], "docker", "exec", self.container_name, "bash", "-lc",
], spec["install"],
check=True, ],
) check=True,
)
except subprocess.CalledProcessError as e:
logger.error(
f"Installing {tool} failed with exit status "
f"{e.returncode}; see the installer output above."
)
sys.exit(1)
paths = spec["path"] if isinstance(spec["path"], list) else [spec["path"]] paths = spec["path"] if isinstance(spec["path"], list) else [spec["path"]]
for path_expr in paths: for path_expr in paths:
self._ensure_path_entry(path_expr) self._ensure_path_entry(path_expr)