use warning level for "Cannot encrypt using the imported key" error

This commit is contained in:
Son NK 2020-12-31 11:05:11 +01:00
parent 74a63db835
commit 0585ba97ee

View file

@ -43,7 +43,9 @@ def load_public_key_and_check(public_key: str) -> str:
try:
encrypt_file(dummy_data, fingerprint)
except Exception as e:
LOG.exception("Cannot encrypt using the imported key")
LOG.warning(
"Cannot encrypt using the imported key %s %s", fingerprint, public_key
)
# remove the fingerprint
gpg.delete_keys([fingerprint])
raise PGPException("Encryption fails with the key") from e