From c98bdd6988ac50c995b37256b077fb8aacec357d Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Wed, 30 Mar 2016 13:33:55 -0700 Subject: [PATCH] Don't try to test empty hooks --- letsencrypt/hooks.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/letsencrypt/hooks.py b/letsencrypt/hooks.py index f6450022f..ed491ab72 100644 --- a/letsencrypt/hooks.py +++ b/letsencrypt/hooks.py @@ -26,14 +26,13 @@ def _validate_hook(shell_cmd, hook_name): :raises .errors.HookCommandNotFound: if the command is not found """ - cmd = shell_cmd.partition(" ")[0] - if shell_cmd and not _prog(cmd): - path = os.environ["PATH"] - msg = "Unable to find {2}-hook command {0} in the PATH.\n(PATH is {1})".format( - cmd, path, hook_name) - raise errors.HookCommandNotFound(msg) - - return True + if shell_cmd: + cmd = shell_cmd.partition(" ")[0] + if not _prog(cmd): + path = os.environ["PATH"] + msg = "Unable to find {2}-hook command {0} in the PATH.\n(PATH is {1})".format( + cmd, path, hook_name) + raise errors.HookCommandNotFound(msg) def pre_hook(config): "Run pre-hook if it's defined and hasn't been run."