-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[RHELC-560, RHELC-166] Create a BackupController Framework and a rpm …
…gpg key plugin (#516) * Create a BackupController Framework and a rpm gpg key plugin The BackupController framework is a pluggable way to make changes to the system that we can revert at a later date. It consists of a BackupController object which we instantiate once per convert2rhel run. The API of the BackupController consists of: * a push() method. When a RestorableChange is pushed onto the BackupController's stack, the BackupController will call the RestorableChange's enable() method and then store the change on the BackupController's stack. * a pop() method. This will pop the last RestorableChange off of the stack, call the change's restore() method, and then return the change to the caller. * a pop_all() method. This will call the restore() method on all of the RestorableChanges() and then return the list of all the changes to the caller. RestorableChanges are objects which implement the following API: * An enable() method. When this is called, it should backup any data that would be needed to rollback the change and then will make the requested change. * A restore() method. When this is called, it should undo the changes made by the enable() method. This commit also include a RestorableRpmKey class which implements RestorableChange for rpm gpg keys. Upon enable(), the class will record whether the key is already present in the rpm database. If it isn't, it will then be added. On restore(), it will check whether the key was installed before enable() was called. If it wasn't, it will uninstall that key. pkghandler.install_gpg_keys() has been enhanced to use the RestorableRpmKey() and the step that installs gpg keys has been moved into the Pre-ponr section of the code.
- Loading branch information
Showing
9 changed files
with
635 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.