clan-cli: Replace HostGroup and MachineGroup with generic AsyncRuntime class. Propagate cmd prefix over thread local. Close threads on CTRL+C

This commit is contained in:
Qubasa
2024-12-09 18:07:23 +01:00
parent f30e9fed9b
commit 65a5789c5b
18 changed files with 549 additions and 436 deletions

View File

@@ -1,7 +1,7 @@
from typing import TYPE_CHECKING
import pytest
from clan_cli.ssh.host_group import HostGroup
from clan_cli.ssh.host import Host
from fixtures_flakes import FlakeForTest
from helpers import cli
@@ -13,7 +13,7 @@ if TYPE_CHECKING:
def test_secrets_upload(
monkeypatch: pytest.MonkeyPatch,
test_flake_with_core: FlakeForTest,
host_group: HostGroup,
hosts: list[Host],
age_keys: list["KeyPair"],
) -> None:
monkeypatch.chdir(test_flake_with_core.path)
@@ -48,7 +48,7 @@ def test_secrets_upload(
)
flake = test_flake_with_core.path.joinpath("flake.nix")
host = host_group.hosts[0]
host = hosts[0]
addr = f"{host.user}@{host.host}:{host.port}?StrictHostKeyChecking=no&UserKnownHostsFile=/dev/null&IdentityFile={host.key}"
new_text = flake.read_text().replace("__CLAN_TARGET_ADDRESS__", addr)