From bd9239a8ca59e0dbc662a36453129375e0355bde Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Fri, 22 Sep 2017 17:12:33 -0700 Subject: [PATCH] Add hook dir properties to configuration --- certbot/configuration.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/certbot/configuration.py b/certbot/configuration.py index 30c6f0437..297795609 100644 --- a/certbot/configuration.py +++ b/certbot/configuration.py @@ -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