various fixes

This commit is contained in:
Jörg Thalheim
2025-08-26 12:59:49 +02:00
parent 1dda60847e
commit 63697ac4b1
5 changed files with 12 additions and 12 deletions

View File

@@ -140,14 +140,16 @@ def run_machine_update(
"""
with ExitStack() as stack:
_target_host: Host = cast(
Host, stack.enter_context(target_host.host_connection())
"Host", stack.enter_context(target_host.host_connection())
)
_build_host: Host
# If no build host is specified, use the target host as the build host.
if build_host is None:
_build_host = _target_host
else:
_build_host = cast(Host, stack.enter_context(build_host.host_connection()))
_build_host = cast(
"Host", stack.enter_context(build_host.host_connection())
)
# Some operations require root privileges on the target host.
target_host_root = stack.enter_context(_target_host.become_root())