From 86fc551af60736ea407b211cc60a3bad56d88c06 Mon Sep 17 00:00:00 2001 From: PietroPasotti Date: Mon, 29 Jul 2024 10:30:52 +0200 Subject: [PATCH] Fix warning cert none charm logging (#425) * fixed issue with warning if cert returns None * removed unused import --------- Co-authored-by: Luca Bello <36242061+lucabello@users.noreply.github.com> --- lib/charms/loki_k8s/v0/charm_logging.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/charms/loki_k8s/v0/charm_logging.py b/lib/charms/loki_k8s/v0/charm_logging.py index cea0393d7..559aa9bee 100644 --- a/lib/charms/loki_k8s/v0/charm_logging.py +++ b/lib/charms/loki_k8s/v0/charm_logging.py @@ -97,7 +97,7 @@ def my_server_cert(self) -> Optional[str]: # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 1 +LIBPATCH = 2 PYDEPS = ["cosl"] @@ -197,11 +197,7 @@ def _get_server_cert( # we're assuming that the ca cert that signed this unit is the same that has signed loki's if server_cert is None: - logger.debug(f"{charm.__name__}.{server_cert_getter} returned None.") - logger.warning( - "Charm logs are being sent over insecure http because a ca cert is " - "not provided to the charm_logging module." - ) + logger.debug(f"{charm.__name__}.{server_cert_getter} returned None: can't use https.") return None if not isinstance(server_cert, str) and not isinstance(server_cert, Path):