Fixed )( and if/else

This commit is contained in:
jigen 2020-02-25 18:30:20 +01:00
parent 5d13a5c70c
commit b684ad330a

View file

@ -346,22 +346,21 @@ if __name__ == '__main__':
logger.error('Error asking certificate for {}'.format(vhost_name)) logger.error('Error asking certificate for {}'.format(vhost_name))
if args.renew: if args.renew:
pre_hook_cmd = "" pre_hook_cmd = None
post_hook_cmd = "" post_hook_cmd = None
logging.info('Renewing certificates ') logging.info('Renewing certificates ')
if set(['webmail','hosting','liste']) & set(service_reload.keys()): if set(['webmail','hosting','liste']) & set(service_reload.keys()):
post_hook_cmd += " && systemctl reload apache2") post_hook_cmd = "systemctl reload apache2"
if set(['smtp',]) & set(service_reload.keys()): elif set(['smtp',]) & set(service_reload.keys()):
post_hook_cmd += " && systemctl reload postfix") post_hook_cmd = "systemctl reload postfix"
if set(['mbox',]) & set(service_reload.keys()): elif set(['mbox',]) & set(service_reload.keys()):
post_hook_cmd += " && systemctl restart dovecot") post_hook_cmd = "systemctl restart dovecot"
logger.info("post_hook_cmd: {}".format(post_hook_cmd) logger.debug("post_hook_cmd: {}".format(post_hook_cmd))
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:
if set(['webmail','hosting','liste']) & set(service_reload.keys()): if set(['webmail','hosting','liste']) & set(service_reload.keys()):
# reload apache # reload apache
logger.info("Restarting apache") logger.info("Restarting apache")