mirror of
https://github.com/certbot/certbot.git
synced 2026-05-28 04:34:11 -04:00
Actually validate hooks
This commit is contained in:
parent
3265660478
commit
8b8319355d
2 changed files with 4 additions and 1 deletions
|
|
@ -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):
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue