From d0362bb7572646909088ef3944a9d8119c83470c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Thu, 30 Nov 2023 10:49:55 +0100 Subject: [PATCH] error if age key cannot be decoded --- pkgs/clan-cli/clan_cli/secrets/sops.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/clan-cli/clan_cli/secrets/sops.py b/pkgs/clan-cli/clan_cli/secrets/sops.py index 213616280..c23f08f2c 100644 --- a/pkgs/clan-cli/clan_cli/secrets/sops.py +++ b/pkgs/clan-cli/clan_cli/secrets/sops.py @@ -23,7 +23,9 @@ class SopsKey: def get_public_key(privkey: str) -> str: cmd = nix_shell(["age"], ["age-keygen", "-y"]) try: - res = subprocess.run(cmd, input=privkey, stdout=subprocess.PIPE, text=True) + res = subprocess.run( + cmd, input=privkey, stdout=subprocess.PIPE, text=True, check=True + ) except subprocess.CalledProcessError as e: raise ClanError( "Failed to get public key for age private key. Is the key malformed?"