MCPcopy
hub / github.com/certbot/certbot / deploy_hook

Function deploy_hook

certbot/src/certbot/_internal/hooks.py:192–219  ·  view source on GitHub ↗

Run post-renewal/post-issuance hooks. This function runs any hooks found in config.renewal_deploy_hooks_dir followed by any deploy-hook in the config. If the deploy-hook in the config is a path to a script in config.renewal_deploy_hooks_dir, it is not run twice. If Certbot is d

(config: configuration.NamespaceConfig, sans: list[san.SAN],
                lineage_path: str)

Source from the content-addressed store, hash-verified

190
191
192def deploy_hook(config: configuration.NamespaceConfig, sans: list[san.SAN],
193 lineage_path: str) -> None:
194 """Run post-renewal/post-issuance hooks.
195
196 This function runs any hooks found in
197 config.renewal_deploy_hooks_dir followed by any deploy-hook in the
198 config. If the deploy-hook in the config is a path to a script in
199 config.renewal_deploy_hooks_dir, it is not run twice.
200
201 If Certbot is doing a dry run, no hooks are run and messages are
202 logged saying that they were skipped.
203
204 :param configuration.NamespaceConfig config: Certbot settings
205 :param sans: domains and/or IP addresses in the obtained certificate
206 :type sans: `list` of `san.SAN`
207 :param str lineage_path: live directory path for the new cert
208
209 """
210 executed_hooks = set()
211 all_hooks: list[str] = (list_hooks(config.renewal_deploy_hooks_dir) if config.directory_hooks
212 else [])
213 all_hooks += [config.deploy_hook] if config.deploy_hook else []
214 for hook in all_hooks:
215 if hook in executed_hooks:
216 logger.info("Skipping deploy-hook '%s' as it was already run.", hook)
217 else:
218 _run_deploy_hook(hook, sans, lineage_path, config.dry_run, config.run_deploy_hooks)
219 executed_hooks.add(hook)
220
221
222def _run_deploy_hook(command: str, sans: list[san.SAN], lineage_path: str, dry_run: bool,

Callers 1

_callMethod · 0.90

Calls 3

list_hooksFunction · 0.85
_run_deploy_hookFunction · 0.85
addMethod · 0.45

Tested by 1

_callMethod · 0.72