API|CLI: Added argument 'flake_name' to all CLI and API endpoints. Tests missing.

This commit is contained in:
2023-10-13 22:29:55 +02:00
parent 740e5e2ebc
commit 06d6edbfa7
23 changed files with 195 additions and 105 deletions

View File

@@ -1,9 +1,9 @@
from .folders import machine_folder
from ..dirs import specific_machine_dir
def machine_has_fact(machine: str, fact: str) -> bool:
return (machine_folder(machine) / "facts" / fact).exists()
def machine_has_fact(flake_name: str, machine: str, fact: str) -> bool:
return (specific_machine_dir(flake_name, machine) / "facts" / fact).exists()
def machine_get_fact(machine: str, fact: str) -> str:
return (machine_folder(machine) / "facts" / fact).read_text()
def machine_get_fact(flake_name: str, machine: str, fact: str) -> str:
return (specific_machine_dir(flake_name, machine) / "facts" / fact).read_text()