move checks if targetHost/buildHost is set to cli

This commit is contained in:
Jörg Thalheim
2024-02-06 14:45:21 +01:00
parent 35bb076729
commit ad1a87fc14
4 changed files with 13 additions and 10 deletions

View File

@@ -154,14 +154,11 @@ def get_all_machines(clan_dir: Path) -> HostGroup:
hosts = []
for name, machine_data in machines.items():
# very hacky. would be better to do a MachinesGroup instead
machine = Machine(name=name, flake=clan_dir, deployment_info=machine_data)
host = parse_deployment_address(
name,
machine_data.get("targetHost") or machine_data.get("deploymentAddress"),
meta={
"machine": Machine(
name=name, flake=clan_dir, deployment_info=machine_data
)
},
host=machine.target_host,
meta={"machine": machine},
)
hosts.append(host)
return HostGroup(hosts)