{vars,facts}/generate: ensure that args.flake is passed

This commit is contained in:
Jörg Thalheim
2024-10-02 12:03:55 +02:00
committed by Mic92
parent b1b05485dd
commit db11e7cb92
2 changed files with 6 additions and 0 deletions

View File

@@ -218,6 +218,9 @@ def generate_facts(
def generate_command(args: argparse.Namespace) -> None: def generate_command(args: argparse.Namespace) -> None:
if args.flake is None:
msg = "Could not find clan flake toplevel directory"
raise ClanError(msg)
if len(args.machines) == 0: if len(args.machines) == 0:
machines = get_all_machines(args.flake, args.option) machines = get_all_machines(args.flake, args.option)
else: else:

View File

@@ -367,6 +367,9 @@ def generate_vars(
def generate_command(args: argparse.Namespace) -> None: def generate_command(args: argparse.Namespace) -> None:
if args.flake is None:
msg = "Could not find clan flake toplevel directory"
raise ClanError(msg)
if len(args.machines) == 0: if len(args.machines) == 0:
machines = get_all_machines(args.flake, args.option) machines = get_all_machines(args.flake, args.option)
else: else: