From 9831fefc554fd1ecd9a92c973e269bd28087eae6 Mon Sep 17 00:00:00 2001 From: Miguel Angel Ajo Pelayo Date: Tue, 29 Jul 2025 12:27:50 +0200 Subject: [PATCH] Fix the exporter logs functionality fix the error: AttributeError: ClientConfigV1Alpha1 object has no attribute shell_use_profiles --- .../jumpstarter-cli/jumpstarter_cli/shell.py | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/packages/jumpstarter-cli/jumpstarter_cli/shell.py b/packages/jumpstarter-cli/jumpstarter_cli/shell.py index 521a5b2ce..1a696d393 100644 --- a/packages/jumpstarter-cli/jumpstarter_cli/shell.py +++ b/packages/jumpstarter-cli/jumpstarter_cli/shell.py @@ -39,6 +39,15 @@ def shell(config, command: tuple[str, ...], lease_name, selector, duration, expo match config: case ClientConfigV1Alpha1(): exit_code = 0 + def _launch_remote_shell(path: str) -> int: + return launch_shell( + path, + "remote", + config.drivers.allow, + config.drivers.unsafe, + config.shell.use_profiles, + command=command, + ) with config.lease(selector=selector, lease_name=lease_name, duration=duration) as lease: with lease.serve_unix() as path: @@ -46,24 +55,10 @@ def shell(config, command: tuple[str, ...], lease_name, selector, duration, expo if exporter_logs: with lease.connect() as client: with client.log_stream(): - exit_code = launch_shell( - path, - "remote", - config.drivers.allow, - config.drivers.unsafe, - config.shell_use_profiles, - command=command, - ) + exit_code = _launch_remote_shell(path) else: - exit_code = launch_shell( - path, - "remote", - config.drivers.allow, - config.drivers.unsafe, - config.shell.use_profiles, - command=command, - ) - + exit_code = _launch_remote_shell(path) + # we exit here to make sure that all the with clauses unwind sys.exit(exit_code) case ExporterConfigV1Alpha1():