From 0f3398e85aed6067d68ae2311b326cb0737a3a31 Mon Sep 17 00:00:00 2001 From: telcobot <147593099+telcobot@users.noreply.github.com> Date: Fri, 20 Dec 2024 12:31:47 +0400 Subject: [PATCH] chore: Update charm libraries (#393) --- .../tls_certificates_interface/v4/tls_certificates.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/charms/tls_certificates_interface/v4/tls_certificates.py b/lib/charms/tls_certificates_interface/v4/tls_certificates.py index cb24d77..278207d 100644 --- a/lib/charms/tls_certificates_interface/v4/tls_certificates.py +++ b/lib/charms/tls_certificates_interface/v4/tls_certificates.py @@ -52,7 +52,7 @@ # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 4 +LIBPATCH = 5 PYDEPS = ["cryptography", "pydantic"] @@ -1030,7 +1030,14 @@ def _mode_is_valid(self, mode: Mode) -> bool: def _on_secret_remove(self, event: SecretRemoveEvent) -> None: """Handle Secret Removed Event.""" - event.secret.remove_revision(event.revision) + try: + event.secret.remove_revision(event.revision) + except SecretNotFoundError: + logger.warning( + "No such secret %s, nothing to remove", + event.secret.label or event.secret.id, + ) + return def _on_secret_expired(self, event: SecretExpiredEvent) -> None: """Handle Secret Expired Event.