letsencrypt_apache.augeas_configurator

Class of Augeas Configurators.

class letsencrypt_apache.augeas_configurator.AugeasConfigurator(*args, **kwargs)[source]

Bases: letsencrypt.plugins.common.Plugin

Base Augeas Configurator class.

Variables:
  • config – Configuration.
  • aug – Augeas object
  • save_notes (str) – Human-readable configuration change notes
  • reverter – saves and reverts checkpoints
check_parsing_errors(lens)[source]

Verify Augeas can parse all of the lens files.

Parameters:lens (str) – lens to check for errors
Raises:.errors.PluginError – If there has been an error in parsing with the specified lens.
save(title=None, temporary=False)[source]

Saves all changes to the configuration files.

This function first checks for save errors, if none are found, all configuration changes made will be saved. According to the function parameters. If an exception is raised, a new checkpoint was not created.

Parameters:
  • title (str) – The title of the save. If a title is given, the configuration will be saved as a new checkpoint and put in a timestamped directory.
  • temporary (bool) – Indicates whether the changes made will be quickly reversed in the future (ie. challenges)
Raises:

.errors.PluginError – If there was an error in Augeas, in an attempt to save the configuration, or an error creating a checkpoint

_log_save_errors(ex_errs)[source]

Log errors due to bad Augeas save.

Parameters:ex_errs (list) – Existing errors before save
recovery_routine()[source]

Revert all previously modified files.

Reverts all modified files that have not been saved as a checkpoint

Raises:.errors.PluginError – If unable to recover the configuration
revert_challenge_config()[source]

Used to cleanup challenge configurations.

Raises:.errors.PluginError – If unable to revert the challenge config.
rollback_checkpoints(rollback=1)[source]

Rollback saved checkpoints.

Parameters:rollback (int) – Number of checkpoints to revert
Raises:.errors.PluginError – If there is a problem with the input or the function is unable to correctly revert the configuration
view_config_changes()[source]

Show all of the configuration changes that have taken place.

Raises:.errors.PluginError – If there is a problem while processing the checkpoints directories.