apply TRY lint

This commit is contained in:
Jörg Thalheim
2024-09-03 17:56:59 +02:00
parent 68d777166a
commit 403b9cf2cc
26 changed files with 70 additions and 49 deletions

View File

@@ -56,10 +56,11 @@ def generate_private_key(out_file: Path | None = None) -> tuple[str, str]:
if out_file:
out_file.parent.mkdir(parents=True, exist_ok=True)
out_file.write_text(res)
return private_key, pubkey
except subprocess.CalledProcessError as e:
msg = "Failed to generate private sops key"
raise ClanError(msg) from e
else:
return private_key, pubkey
def get_user_name(flake_dir: Path, user: str) -> str: