mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Use a set for pre_hook.already
This commit is contained in:
parent
b748f1afe4
commit
458c7c8131
2 changed files with 3 additions and 3 deletions
|
|
@ -54,11 +54,11 @@ def pre_hook(config):
|
|||
if cmd and cmd not in pre_hook.already:
|
||||
logger.info("Running pre-hook command: %s", cmd)
|
||||
_run_hook(cmd)
|
||||
pre_hook.already[cmd] = True
|
||||
pre_hook.already.add(cmd)
|
||||
elif cmd:
|
||||
logger.info("Pre-hook command already run, skipping: %s", cmd)
|
||||
|
||||
pre_hook.already = {}
|
||||
pre_hook.already = set()
|
||||
|
||||
|
||||
def post_hook(config):
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class HookTest(unittest.TestCase):
|
|||
return mock_logger.warning
|
||||
|
||||
def test_pre_hook(self):
|
||||
hooks.pre_hook.already = {}
|
||||
hooks.pre_hook.already = set()
|
||||
config = mock.MagicMock(pre_hook="true")
|
||||
self._test_a_hook(config, hooks.pre_hook, 1)
|
||||
self._test_a_hook(config, hooks.pre_hook, 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue