allow list of domains instead of dict
parent
bfcd643dac
commit
58496cdb40
|
@ -345,6 +345,19 @@ def main():
|
||||||
logging.error(f"Unable to load config file: {e}")
|
logging.error(f"Unable to load config file: {e}")
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
if isinstance(config["domains"], list):
|
||||||
|
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)
|
||||||
|
else:
|
||||||
|
domain_duplicates.add(domain.name)
|
||||||
|
logging.error(f"Duplicate domain name(s) found: {domain_uniques}")
|
||||||
|
return 2
|
||||||
|
|
||||||
try:
|
try:
|
||||||
domains_to_renew = []
|
domains_to_renew = []
|
||||||
for domain_name, domain_details in config["domains"].items():
|
for domain_name, domain_details in config["domains"].items():
|
||||||
|
@ -385,7 +398,7 @@ def main():
|
||||||
domain.renew_cert(challenge, force=args.force)
|
domain.renew_cert(challenge, force=args.force)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logging.exception(e)
|
logging.exception(e)
|
||||||
return 2
|
return 3
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
Loading…
Reference in New Issue