S101: fix
This commit is contained in:
@@ -262,7 +262,9 @@ def add_secret(
|
||||
|
||||
def get_groups(flake_dir: Path, what: str, name: str) -> list[str]:
|
||||
"""Returns the list of group names the given user or machine is part of."""
|
||||
assert what in {"users", "machines"}
|
||||
if what not in {"users", "machines"}:
|
||||
msg = f"Invalid 'what' parameter: {what}. Must be 'users' or 'machines'"
|
||||
raise ClanError(msg)
|
||||
|
||||
groups_dir = sops_groups_folder(flake_dir)
|
||||
if not groups_dir.exists():
|
||||
|
||||
@@ -80,7 +80,9 @@ def migrate_files(
|
||||
files_to_commit = []
|
||||
for file in generator.files:
|
||||
if _migration_file_exists(machine, generator, file.name):
|
||||
assert generator.migrate_fact is not None
|
||||
if generator.migrate_fact is None:
|
||||
msg = f"Generator {generator.name} has no migrate_fact defined"
|
||||
raise ClanError(msg)
|
||||
files_to_commit += _migrate_file(
|
||||
machine,
|
||||
generator,
|
||||
|
||||
Reference in New Issue
Block a user