PGH003: fix
This commit is contained in:
@@ -4,6 +4,7 @@ import os
|
||||
import re
|
||||
import shlex
|
||||
from contextlib import ExitStack
|
||||
from typing import cast
|
||||
|
||||
from clan_cli.facts.generate import generate_facts
|
||||
from clan_cli.facts.upload import upload_secrets
|
||||
@@ -138,13 +139,15 @@ def run_machine_update(
|
||||
|
||||
"""
|
||||
with ExitStack() as stack:
|
||||
_target_host: Host = stack.enter_context(target_host.host_connection()) # type: ignore
|
||||
_target_host: Host = cast(
|
||||
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 # type: ignore
|
||||
_build_host = _target_host
|
||||
else:
|
||||
_build_host = stack.enter_context(build_host.host_connection()) # type: ignore
|
||||
_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())
|
||||
|
||||
Reference in New Issue
Block a user