vms/create: drop extra flake argument and make it work with local flakes
All checks were successful
checks-impure / test (pull_request) Successful in 1m54s
checks / test (pull_request) Successful in 2m59s

This commit is contained in:
Jörg Thalheim 2023-11-10 13:43:14 +01:00
parent c8e1acac2b
commit 54ede8a0ff
2 changed files with 3 additions and 8 deletions

View File

@ -193,7 +193,7 @@ def create_vm(vm: VmConfig, nix_options: list[str] = []) -> BuildVmTask:
def create_command(args: argparse.Namespace) -> None:
flake_url = args.flake
if not is_flake_url(args.flake):
if not is_flake_url(str(args.flake)):
flake_url = specific_flake_dir(args.flake)
vm = asyncio.run(inspect_vm(flake_url=flake_url, flake_attr=args.machine))
@ -203,10 +203,5 @@ def create_command(args: argparse.Namespace) -> None:
def register_create_parser(parser: argparse.ArgumentParser) -> None:
parser.add_argument("machine", type=str)
parser.add_argument(
"flake",
type=str,
help="name of the flake to create machine for",
)
parser.add_argument("machine", type=str, help="machine in the flake to create")
parser.set_defaults(func=create_command)

View File

@ -40,4 +40,4 @@ def test_create(
age_keys[0].pubkey,
]
)
cli.run(["vms", "create", "vm1", test_flake_with_core.name])
cli.run(["vms", "create", "vm1"])