mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 16:30:31 +02:00
Actually validate hooks
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user