mirror of
https://github.com/certbot/certbot.git
synced 2026-04-15 22:20:28 -04:00
Unbreak repeated insertion logic
This commit is contained in:
parent
33de782fba
commit
de77dd74ad
1 changed files with 6 additions and 5 deletions
|
|
@ -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 = []
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue