vms/create: drop extra flake argument and make it work with local flakes
This commit is contained in:
parent
c8e1acac2b
commit
54ede8a0ff
@ -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)
|
||||
|
@ -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"])
|
||||
|
Loading…
Reference in New Issue
Block a user