clan-cli: Use Remote class in DeployInfo, add tests for qrcode parser and json parser

This commit is contained in:
Qubasa
2025-06-07 00:51:24 +02:00
parent d38fc3cb35
commit 2ca3b5d698
12 changed files with 301 additions and 151 deletions

View File

@@ -156,7 +156,7 @@ def install_machine(opts: InstallOptions) -> None:
def install_command(args: argparse.Namespace) -> None:
host_key_check = HostKeyCheck.from_str(args.host_key_check)
HostKeyCheck.from_str(args.host_key_check)
try:
# Only if the caller did not specify a target_host via args.target_host
# Find a suitable target_host that is reachable
@@ -165,17 +165,17 @@ def install_command(args: argparse.Namespace) -> None:
use_tor = False
if deploy_info and not args.target_host:
host = find_reachable_host(deploy_info, host_key_check)
host = find_reachable_host(deploy_info)
if host is None:
use_tor = True
target_host = f"root@{deploy_info.tor}"
target_host = deploy_info.tor.target
else:
target_host = host.target
if args.password:
password = args.password
elif deploy_info and deploy_info.pwd:
password = deploy_info.pwd
elif deploy_info and deploy_info.addrs[0].password:
password = deploy_info.addrs[0].password
else:
password = None

View File

@@ -121,7 +121,7 @@ def deploy_machine(machine: Machine) -> None:
upload_secrets(machine, sudo_host)
upload_secret_vars(machine, sudo_host)
path = upload_sources(machine, host)
path = upload_sources(machine, sudo_host)
nix_options = [
"--show-trace",