From 57440e1513987c8b5ce4e475a47628b3be0ecdd8 Mon Sep 17 00:00:00 2001 From: Markus Hauschild Date: Sun, 10 Jan 2016 17:36:20 +0100 Subject: [PATCH] Handle empty domain config --- acertmgr.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/acertmgr.py b/acertmgr.py index 9000d0e..5b665b6 100755 --- a/acertmgr.py +++ b/acertmgr.py @@ -107,14 +107,16 @@ if __name__ == "__main__": if config_file.endswith(".conf"): with open(ACME_CONFD + config_file) as config_fd: config['domains'].update(yaml.load(config_fd)) - print(str(config)) + #print(str(config)) # check certificate validity and obtain/renew certificates if needed for domain, domaincfgs in config['domains'].iteritems(): crt_file = ACME_DIR + "%s.crt" % domain ttl_days = int(config.get('ttl_days', 15)) if not cert_isValid(crt_file, ttl_days): - cert_get(domain, config) - for domaincfg in domaincfgs: - cfg = complete_config(domaincfg, config['defaults']) - cert_put(domain, cfg) + # don't get certs for domains without any output files + if domaincfgs: + cert_get(domain, config) + for domaincfg in domaincfgs: + cfg = complete_config(domaincfg, config['defaults']) + cert_put(domain, cfg)