From 993c6472db4318158e569ef2bbe97b24035afe1f Mon Sep 17 00:00:00 2001 From: Jens Langhammer Date: Mon, 28 Mar 2022 08:58:23 +0000 Subject: [PATCH] crypto: only count discovered when cert was loaded successfully --- authentik/crypto/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/authentik/crypto/tasks.py b/authentik/crypto/tasks.py index 54b329800..6b9cfe392 100644 --- a/authentik/crypto/tasks.py +++ b/authentik/crypto/tasks.py @@ -67,9 +67,9 @@ def certificate_discovery(self: MonitoredTask): private_keys[cert_name] = ensure_private_key_valid(body) else: certs[cert_name] = ensure_certificate_valid(body) + discovered += 1 except (OSError, ValueError) as exc: LOGGER.warning("Failed to open file or invalid format", exc=exc, file=path) - discovered += 1 for name, cert_data in certs.items(): cert = CertificateKeyPair.objects.filter(managed=MANAGED_DISCOVERED % name).first() if not cert: