mirror of
https://github.com/certbot/certbot.git
synced 2026-07-30 18:04:31 +02:00
Add hook directories (#5151)
* Add hook dir constants * Add hook dir properties to configuration * test hook dir properties * reuse certbot.util.is_exe * Add certbot.hooks.list_hooks * test list_hooks * Run pre-hooks in directory * Run deploy-hooks in directory * Run post-hooks in directory * Refactor and update certbot/tests/hook_test.py * Add integration tests for hook directories * Have Certbot create hook directories. * document renewal hook directories * Add --no-directory-hooks * Make minor note about locale independent sorting
This commit is contained in:
@@ -108,6 +108,30 @@ class NamespaceConfig(object):
|
||||
return os.path.join(
|
||||
self.namespace.config_dir, constants.RENEWAL_CONFIGS_DIR)
|
||||
|
||||
@property
|
||||
def renewal_hooks_dir(self):
|
||||
"""Path to directory with hooks to run with the renew subcommand."""
|
||||
return os.path.join(self.namespace.config_dir,
|
||||
constants.RENEWAL_HOOKS_DIR)
|
||||
|
||||
@property
|
||||
def renewal_pre_hooks_dir(self):
|
||||
"""Path to the pre-hook directory for the renew subcommand."""
|
||||
return os.path.join(self.renewal_hooks_dir,
|
||||
constants.RENEWAL_PRE_HOOKS_DIR)
|
||||
|
||||
@property
|
||||
def renewal_deploy_hooks_dir(self):
|
||||
"""Path to the deploy-hook directory for the renew subcommand."""
|
||||
return os.path.join(self.renewal_hooks_dir,
|
||||
constants.RENEWAL_DEPLOY_HOOKS_DIR)
|
||||
|
||||
@property
|
||||
def renewal_post_hooks_dir(self):
|
||||
"""Path to the post-hook directory for the renew subcommand."""
|
||||
return os.path.join(self.renewal_hooks_dir,
|
||||
constants.RENEWAL_POST_HOOKS_DIR)
|
||||
|
||||
|
||||
def check_config_sanity(config):
|
||||
"""Validate command line options and display error message if
|
||||
|
||||
Reference in New Issue
Block a user