Fix typos in certbot-new certificates clearing feature

This commit is contained in:
Théophile Diot 2024-05-31 15:24:07 +01:00
parent 701d6f1d37
commit b2ab1a5867
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06

View file

@ -172,7 +172,7 @@ try:
if getenv("LETS_ENCRYPT_CLEAR_OLD_CERTS", "no") == "yes":
LOGGER.info("Clear old certificates is activated, removing old / no longer used certificates...")
for elem in chain(DATA_PATH.glob("archive/*"), DATA_PATH.glob("live/*"), DATA_PATH.glob("renewal/*")):
if elem.stem not in generated_domains and elem.stem != "README":
if elem.name.replace(".conf", "") not in generated_domains and elem.name != "README":
LOGGER.warning(f"Removing old certificate {elem}")
if elem.is_dir():
rmtree(elem, ignore_errors=True)