Coverage for certbot/hooks.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
"""Facilities for implementing hooks that call shell commands."""
"""Check hook commands are executable."""
"""Extract the program run by a shell command.
:param str shell_cmd: command to be executed
:returns: basename of command or None if the command isn't found :rtype: str or None
"""
"""Check that a command provided as a hook is plausibly executable.
:raises .errors.HookCommandNotFound: if the command is not found """ else: cmd, path, hook_name)
"""Run pre-hooks if they exist and haven't already been run.
When Certbot is running with the renew subcommand, this function runs any hooks found in the config.renewal_pre_hooks_dir (if they have not already been run) followed by any pre-hook in the config. If hooks in config.renewal_pre_hooks_dir are run and the pre-hook in the config is a path to one of these scripts, it is not run twice.
:param configuration.NamespaceConfig config: Certbot settings
"""
"""Run the specified pre-hook if we haven't already.
If we've already run this exact command before, a message is logged saying the pre-hook was skipped.
:param str command: pre-hook to be run
""" else:
"""Run post-hooks if defined.
This function also registers any executables found in config.renewal_post_hooks_dir to be run when Certbot is used with the renew subcommand.
If the verb is renew, we delay executing any post-hooks until :func:`run_saved_post_hooks` is called. In this case, this function registers all hooks found in config.renewal_post_hooks_dir to be called followed by any post-hook in the config. If the post-hook in the config is a path to an executable in the post-hook directory, it is not scheduled to be run twice.
:param configuration.NamespaceConfig config: Certbot settings
"""
# In the "renew" case, we save these up to run at the end # certonly / run
"""Registers a post-hook to be run eventually.
All commands given to this function will be run exactly once in the order they were given when :func:`run_saved_post_hooks` is called.
:param str command: post-hook to register to be run
"""
"""Run any post hooks that were saved up in the course of the 'renew' verb"""
"""Run post-issuance hook if defined.
:param configuration.NamespaceConfig config: Certbot settings :param domains: domains in the obtained certificate :type domains: `list` of `str` :param str lineage_path: live directory path for the new cert
""" lineage_path, config.dry_run)
"""Run post-renewal hooks.
This function runs any hooks found in config.renewal_deploy_hooks_dir followed by any renew-hook in the config. If the renew-hook in the config is a path to a script in config.renewal_deploy_hooks_dir, it is not run twice.
If Certbot is doing a dry run, no hooks are run and messages are logged saying that they were skipped.
:param configuration.NamespaceConfig config: Certbot settings :param domains: domains in the obtained certificate :type domains: `list` of `str` :param str lineage_path: live directory path for the new cert
"""
config.renew_hook) else: lineage_path, config.dry_run)
"""Run the specified deploy-hook (if not doing a dry run).
If dry_run is True, command is not run and a message is logged saying that it was skipped. If dry_run is False, the hook is run after setting the appropriate environment variables.
:param str command: command to run as a deploy-hook :param domains: domains in the obtained certificate :type domains: `list` of `str` :param str lineage_path: live directory path for the new cert :param bool dry_run: True iff Certbot is doing a dry run
""" command)
"""Run a hook command.
:returns: stderr if there was any"""
"""Run a command.
:returns: `tuple` (`str` stderr, `str` stdout)"""
# universal_newlines causes Popen.communicate() # to return str objects instead of bytes in Python 3 stderr=PIPE, universal_newlines=True) shell_cmd, cmd.returncode)
"""List paths to all hooks found in dir_path in sorted order.
:param str dir_path: directory to search
:returns: `list` of `str` :rtype: sorted list of absolute paths to executables in dir_path
""" |