fix attribute error

5-trigger-hooks-after-certificate-renewal
HgO 2020-12-25 20:35:39 +01:00
parent 58496cdb40
commit 82f8d5f4e2
1 changed files with 5 additions and 4 deletions

View File

@ -346,15 +346,16 @@ def main():
return 1
if isinstance(config["domains"], list):
domains = {domain.name: domain for domain in config["domains"]}
domains = {domain["name"]: domain for domain in config["domains"]}
if len(domains) != len(config["domains"]):
domain_uniques = set()
domain_duplicates = set()
for domain in config["domains"]:
if domain.name not in domain_uniques:
domain_uniques.add(domain.name)
domain_name = domain["name"]
if domain_name not in domain_uniques:
domain_uniques.add(domain_name)
else:
domain_duplicates.add(domain.name)
domain_duplicates.add(domain_name)
logging.error(f"Duplicate domain name(s) found: {domain_uniques}")
return 2