From 8b8319355df4cf57760d93d8461270e6ab6fa53e Mon Sep 17 00:00:00 2001 From: Peter Eckersley Date: Tue, 29 Mar 2016 18:45:14 -0700 Subject: [PATCH] Actually validate hooks --- letsencrypt/cli.py | 3 +++ letsencrypt/hooks.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/letsencrypt/cli.py b/letsencrypt/cli.py index 41c6ff186..cc25e3d9e 100644 --- a/letsencrypt/cli.py +++ b/letsencrypt/cli.py @@ -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): diff --git a/letsencrypt/hooks.py b/letsencrypt/hooks.py index f3561628c..b734a89d3 100644 --- a/letsencrypt/hooks.py +++ b/letsencrypt/hooks.py @@ -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)