Added check for apache config section
This commit is contained in:
parent
3ea16ce5f3
commit
8c2ea209c5
1 changed files with 10 additions and 4 deletions
14
OTcerts.py
14
OTcerts.py
|
@ -1,4 +1,5 @@
|
||||||
|
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import errno
|
import errno
|
||||||
|
@ -276,10 +277,9 @@ if __name__ == '__main__':
|
||||||
|
|
||||||
if acme_renew(config, pre_hook_cmd, post_hook_cmd, dryrun=dryrun):
|
if acme_renew(config, pre_hook_cmd, post_hook_cmd, dryrun=dryrun):
|
||||||
logger.info("Done renew")
|
logger.info("Done renew")
|
||||||
|
else:
|
||||||
else:
|
|
||||||
# Fai le nuove richieste per i certificati
|
# Fai le nuove richieste per i certificati
|
||||||
|
|
||||||
# Caso speciale per le webmail
|
# Caso speciale per le webmail
|
||||||
if args.webmail:
|
if args.webmail:
|
||||||
logging.info('Asking certificates for webmail')
|
logging.info('Asking certificates for webmail')
|
||||||
|
@ -290,7 +290,7 @@ if __name__ == '__main__':
|
||||||
link_cert(config, vhost_name, vhost_name, dryrun=dryrun)
|
link_cert(config, vhost_name, vhost_name, dryrun=dryrun)
|
||||||
else:
|
else:
|
||||||
logger.error('Error asking certificate for {}'.format(vhost_name))
|
logger.error('Error asking certificate for {}'.format(vhost_name))
|
||||||
|
|
||||||
# reload apache
|
# reload apache
|
||||||
logger.info("Reloading apache")
|
logger.info("Reloading apache")
|
||||||
# ret = subprocess.run("systemctl reload apache2")
|
# ret = subprocess.run("systemctl reload apache2")
|
||||||
|
@ -300,6 +300,12 @@ if __name__ == '__main__':
|
||||||
# Caso speciale per l'hosting
|
# Caso speciale per l'hosting
|
||||||
if args.hosting:
|
if args.hosting:
|
||||||
logging.info('Asking certificates for hosted web domains')
|
logging.info('Asking certificates for hosted web domains')
|
||||||
|
try:
|
||||||
|
hosting_conf = config['apache']
|
||||||
|
except KeyError as e:
|
||||||
|
logger.error("Error parsing configuration, KeyError {}".format(e))
|
||||||
|
exit(-1)
|
||||||
|
|
||||||
ot_conn=connect_db(dict(config['ot_db']))
|
ot_conn=connect_db(dict(config['ot_db']))
|
||||||
dns_conn=connect_db(dict(config['dns_db']))
|
dns_conn=connect_db(dict(config['dns_db']))
|
||||||
# Subdomains da escludere
|
# Subdomains da escludere
|
||||||
|
|
Loading…
Reference in a new issue