Actually validate hooks

This commit is contained in:
Peter Eckersley 2016-03-29 18:45:14 -07:00
parent 3265660478
commit 8b8319355d
2 changed files with 4 additions and 1 deletions

View file

@ -18,6 +18,7 @@ import letsencrypt
from letsencrypt import constants
from letsencrypt import crypto_util
from letsencrypt import errors
from letsencrypt import hooks
from letsencrypt import interfaces
from letsencrypt import le_util
@ -306,6 +307,8 @@ class HelpfulArgumentParser(object):
if self.detect_defaults: # plumbing
parsed_args.store_false_vars = self.store_false_vars
hooks.validate_hooks(parsed_args)
return parsed_args
def handle_csr(self, parsed_args):

View file

@ -27,7 +27,7 @@ def _validate_hook(shell_cmd):
:raises .errors.HookCommandNotFound: if the command is not found
"""
cmd = shell_cmd.partition(" ")[0]
if not _prog(cmd):
if shell_cmd and not _prog(cmd):
path = os.environ["PATH"]
msg = "Unable to find command {0} in the PATH.\n(PATH is {1})".format(
cmd, path)