Unbreak repeated insertion logic

This commit is contained in:
Peter Eckersley 2016-12-15 17:31:32 -08:00
parent 33de782fba
commit de77dd74ad

View file

@ -55,10 +55,11 @@ def post_hook(config, renew_final=False):
we're called with renew_final=True before actually doing anything.
"""
cmd = config.post_hook
if config.verb == "renew":
if not renew_final:
if config.post_hook:
post_hook.eventually.append(config.post_hook)
if cmd and cmd not in post_hook.eventually:
post_hook.eventually.append(cmd)
else:
for cmd in post_hook.eventually:
logger.info("Running post-hook command: %s", cmd)
@ -66,9 +67,9 @@ def post_hook(config, renew_final=False):
if len(post_hook.eventually) == 0:
logger.info("No renewals attempted, so not running post-hook")
else: # certonly / run
if config.post_hook:
logger.info("Running post-hook command: %s", config.post_hook)
_run_hook(config.post_hook)
if cmd:
logger.info("Running post-hook command: %s", cmd)
_run_hook(cmd)
post_hook.eventually = []