mirror of
https://github.com/certbot/certbot.git
synced 2026-01-26 07:41:33 +03:00
Further document reverter
This commit is contained in:
@@ -24,6 +24,39 @@ logger = logging.getLogger(__name__)
|
||||
class Reverter(object):
|
||||
"""Reverter Class - save and revert configuration checkpoints.
|
||||
|
||||
This class can be used by the plugins, especially installers, to
|
||||
undo changes made to the user's system. Modifications to files and
|
||||
commands to do undo actions taken by the plugin should be registered
|
||||
with this class before the action is taken.
|
||||
|
||||
Once a change has been registered with this class, there are three
|
||||
states the change can be in. First, the change can be a temporary
|
||||
change. This should be used for changes that will soon be reverted,
|
||||
such as config changes for the purpose of solving a challenge.
|
||||
Changes are added to this state through calls to
|
||||
:func:`~add_to_temp_checkpoint` and reverted when
|
||||
:func:`~revert_temporary_config` or :func:`~recovery_routine` is
|
||||
called.
|
||||
|
||||
The second state a change can be in is in progress. These changes
|
||||
are not temporary, however, they also have not been finalized in a
|
||||
checkpoint. A change must become in progress before it can be
|
||||
finalized. Changes are added to this state through calls to
|
||||
:func:`~add_to_checkpoint` and reverted when
|
||||
:func:`~recovery_routine` is called.
|
||||
|
||||
The last state a change can be in is finalized in a checkpoint. A
|
||||
change is put into this state by first becoming an in progress
|
||||
change and then calling :func:`~finalize_checkpoint`. Changes
|
||||
in this state can be reverted through calls to
|
||||
:func:`~rollback_checkpoints`.
|
||||
|
||||
As a final note, creating new files and registering undo commands
|
||||
are handled specially and use the methods
|
||||
:func:`~register_file_creation` and :func:`~register_undo_command`
|
||||
respectively. Both of these methods can be used to create either
|
||||
temporary or in progress changes.
|
||||
|
||||
.. note:: Consider moving everything over to CSV format.
|
||||
|
||||
:param config: Configuration.
|
||||
|
||||
Reference in New Issue
Block a user