From 706e7970f43f3bc1c5f78dc73644787f42f3eaf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Fri, 10 Nov 2023 13:43:14 +0100 Subject: [PATCH] vms/create: drop extra flake argument and make it work with local flakes --- pkgs/clan-cli/clan_cli/vms/create.py | 9 ++------- pkgs/clan-cli/tests/test_vms_cli.py | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/pkgs/clan-cli/clan_cli/vms/create.py b/pkgs/clan-cli/clan_cli/vms/create.py index ebf57f191..854e523e9 100644 --- a/pkgs/clan-cli/clan_cli/vms/create.py +++ b/pkgs/clan-cli/clan_cli/vms/create.py @@ -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) diff --git a/pkgs/clan-cli/tests/test_vms_cli.py b/pkgs/clan-cli/tests/test_vms_cli.py index 204134745..4cd17d14a 100644 --- a/pkgs/clan-cli/tests/test_vms_cli.py +++ b/pkgs/clan-cli/tests/test_vms_cli.py @@ -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"])