pkgs/clan: Add machine validator with suggestion logic
Add machine validator with suggestion logic to: - `clan machines update` - `clan machines delete` - `clan machines update-hardware-config`
This commit is contained in:
@@ -5,6 +5,7 @@ import sys
|
||||
from clan_lib.async_run import AsyncContext, AsyncOpts, AsyncRuntime
|
||||
from clan_lib.errors import ClanError
|
||||
from clan_lib.machines.machines import Machine
|
||||
from clan_lib.machines.suggestions import validate_machine_names
|
||||
from clan_lib.machines.update import deploy_machine
|
||||
from clan_lib.nix import nix_config
|
||||
from clan_lib.ssh.remote import Remote
|
||||
@@ -45,6 +46,9 @@ def update_command(args: argparse.Namespace) -> None:
|
||||
msg = f"No machines found with tags: {', '.join(args.tags)}"
|
||||
raise ClanError(msg)
|
||||
|
||||
if args.machines:
|
||||
validate_machine_names(args.machines, args.flake)
|
||||
|
||||
for machine_name in selected_machines:
|
||||
machine = Machine(name=machine_name, flake=args.flake)
|
||||
machines.append(machine)
|
||||
|
||||
Reference in New Issue
Block a user