Clan-app: refine create machine workflow via query operation

This commit is contained in:
Johannes Kirschbauer
2024-08-06 14:22:24 +02:00
parent 52e2ba9801
commit 6158e82f43
4 changed files with 126 additions and 129 deletions

View File

@@ -31,6 +31,8 @@ def create_machine(flake: FlakeId, machine: Machine) -> None:
if machine.name in full_inventory.machines.keys():
raise ClanError(f"Machine with the name {machine.name} already exists")
print(f"Define machine {machine.name}", machine)
inventory.machines.update({machine.name: machine})
save_inventory(inventory, flake.path, f"Create machine {machine.name}")