crypto: only count discovered when cert was loaded successfully

This commit is contained in:
Jens Langhammer 2022-03-28 08:58:23 +00:00
parent 123b0b2f05
commit 993c6472db
1 changed files with 1 additions and 1 deletions

View File

@ -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: