machines.Machine: refactor flake_dir -> flake; use Machine class in vm
This commit is contained in:
@@ -93,9 +93,7 @@ def get_all_machines(clan_dir: Path) -> HostGroup:
|
||||
name,
|
||||
machine_data["deploymentAddress"],
|
||||
meta={
|
||||
"machine": Machine(
|
||||
name=name, flake_dir=clan_dir, machine_data=machine_data
|
||||
)
|
||||
"machine": Machine(name=name, flake=clan_dir, machine_data=machine_data)
|
||||
},
|
||||
)
|
||||
hosts.append(host)
|
||||
@@ -105,7 +103,7 @@ def get_all_machines(clan_dir: Path) -> HostGroup:
|
||||
def get_selected_machines(machine_names: list[str], flake_dir: Path) -> HostGroup:
|
||||
hosts = []
|
||||
for name in machine_names:
|
||||
machine = Machine(name=name, flake_dir=flake_dir)
|
||||
machine = Machine(name=name, flake=flake_dir)
|
||||
hosts.append(machine.host)
|
||||
return HostGroup(hosts)
|
||||
|
||||
@@ -115,7 +113,7 @@ def update(args: argparse.Namespace) -> None:
|
||||
if args.flake is None:
|
||||
raise ClanError("Could not find clan flake toplevel directory")
|
||||
if len(args.machines) == 1 and args.target_host is not None:
|
||||
machine = Machine(name=args.machines[0], flake_dir=args.flake)
|
||||
machine = Machine(name=args.machines[0], flake=args.flake)
|
||||
machine.deployment_address = args.target_host
|
||||
host = parse_deployment_address(
|
||||
args.machines[0],
|
||||
|
||||
Reference in New Issue
Block a user