make host key check an enum instead of an literal type

this is more typesafe at runtime.
This commit is contained in:
Jörg Thalheim
2025-07-02 17:33:32 +02:00
parent 7f744079a6
commit 3d83017acd
11 changed files with 63 additions and 44 deletions

View File

@@ -33,6 +33,7 @@ from clan_lib.nix_models.clan import (
)
from clan_lib.nix_models.clan import InventoryMachineDeploy as MachineDeploy
from clan_lib.persist.util import set_value_by_path
from clan_lib.ssh.host_key import HostKeyCheck
from clan_lib.ssh.remote import Remote, can_ssh_login
log = logging.getLogger(__name__)
@@ -198,7 +199,7 @@ def test_clan_create_api(
clan_dir_flake.invalidate_cache()
target_host = machine.target_host().override(
private_key=private_key, host_key_check="none"
private_key=private_key, host_key_check=HostKeyCheck.NONE
)
result = can_ssh_login(target_host)
assert result == "Online", f"Machine {machine.name} is not online"