changed cert acme status to a string to add 'unknown' status (when not diagnosed)

This commit is contained in:
axolotle 2022-02-01 18:53:43 +01:00
parent d848837bc6
commit 7b7c5f0b13
2 changed files with 8 additions and 4 deletions

View file

@ -98,9 +98,13 @@ def certificate_status(domains, full=False):
if full:
try:
_check_domain_is_ready_for_ACME(domain)
status["ACME_eligible"] = True
except Exception:
status["ACME_eligible"] = False
status["acme_status"] = 'eligible'
except Exception as e:
if e.key == 'certmanager_domain_not_diagnosed_yet':
status["acme_status"] = 'unknown'
else:
status["acme_status"] = 'ineligible'
del status["domain"]
certificates[domain] = status

View file

@ -192,7 +192,7 @@ def domain_info(domains):
"certificate": {
"authority": certs[domain]["CA_type"]["code"],
"validity": certs[domain]["validity"],
"ACME_eligible": certs[domain]["ACME_eligible"],
"acme_status": certs[domain]["acme_status"],
},
"dns": get_dns_config(domain),
}