Revert "Merge pull request 'clan-cli: Refactor the API to use the Flake object' (#3531) from Qubasa/clan-core:replace_machine_name_with_machine_obj into main"
This reverts commitc09618b323, reversing changes made to45b2539455.
This commit is contained in:
@@ -2,21 +2,20 @@ from dataclasses import dataclass
|
||||
|
||||
from clan_lib.api import API
|
||||
|
||||
from clan_cli.flake import Flake
|
||||
from clan_cli.inventory import Inventory, Meta, load_inventory_json, set_inventory
|
||||
|
||||
|
||||
@dataclass
|
||||
class UpdateOptions:
|
||||
flake: Flake
|
||||
directory: str
|
||||
meta: Meta
|
||||
|
||||
|
||||
@API.register
|
||||
def update_clan_meta(options: UpdateOptions) -> Inventory:
|
||||
inventory = load_inventory_json(options.flake)
|
||||
inventory = load_inventory_json(options.directory)
|
||||
inventory["meta"] = options.meta
|
||||
|
||||
set_inventory(inventory, options.flake, "Update clan metadata")
|
||||
set_inventory(inventory, options.directory, "Update clan metadata")
|
||||
|
||||
return inventory
|
||||
|
||||
Reference in New Issue
Block a user