Chore(api): narrow down get_machine

Dont require the user to pass the machine into the same getter function
The workflow contradicts itself here
This commit is contained in:
Johannes Kirschbauer
2025-06-04 20:38:45 +02:00
parent 5a85d4e1ce
commit ea1c1a5185
2 changed files with 7 additions and 6 deletions

View File

@@ -69,7 +69,7 @@ def query_machines_by_tags(flake: Flake, tags: list[str]) -> dict[str, Machine]:
filtered_machines = {}
for machine in machines.values():
inv_machine = get_machine(machine)
inv_machine = get_machine(machine.flake, machine.name)
machine_tags = inv_machine.get("tags", [])
if all(tag in machine_tags for tag in tags):
filtered_machines[machine.name] = machine
@@ -97,7 +97,7 @@ def extract_header(c: str) -> str:
@API.register
def get_machine_details(machine: Machine) -> MachineDetails:
machine_inv = get_machine(machine)
machine_inv = get_machine(machine.flake, machine.name)
hw_config = HardwareConfig.detect_type(machine)
machine_dir = specific_machine_dir(machine)