def _validate_hooks(self): if self.config.validate_hooks: for name in ('auth-hook', 'cleanup-hook'): hook = self.conf(name) if hook is not None: hook_prefix = self.option_name(name)[:-len('-hook')] hooks.validate_hook(hook, hook_prefix)
def _prepare_scripts(self): """Helper method for prepare, to take care of validating scripts""" script_path = self.conf("auth") cleanup_path = self.conf("cleanup") if self.config.validate_hooks: hooks.validate_hook(script_path, "script_auth") self.auth_script = script_path if cleanup_path: if self.config.validate_hooks: hooks.validate_hook(cleanup_path, "script_cleanup") self.cleanup_script = cleanup_path
def _call(cls, *args, **kwargs): from certbot.hooks import validate_hook return validate_hook(*args, **kwargs)