-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rpm_transaction_conf: introduce actor configs
Add actor configuration using leapp's actor config features. The old transaction conf files are still preserved, but they were never advertised as an official way of modifying the transaction, whereas configs added by this commit are. The configuration is functionally equivalent to the old transaction configuration files.
- Loading branch information
Michal Hecko
committed
Nov 10, 2024
1 parent
e43a892
commit d470c5e
Showing
6 changed files
with
202 additions
and
21 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
Empty file.
66 changes: 66 additions & 0 deletions
66
repos/system_upgrade/common/actors/rpmtransactionconfigtaskscollector/configs/rpm.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
""" | ||
Configuration keys for dnf transactions. | ||
""" | ||
|
||
from leapp.actors.config import Config | ||
from leapp.models import fields | ||
|
||
TRANSACTION_CFG_SECTION_NAME = "transaction" | ||
|
||
|
||
# * Nested containers? | ||
# * Duplication of default value in type_ and Config. If we eliminate that, we need to extract | ||
# default from the type_ for the documentation. | ||
# * We probably want to allow dicts in Config. But IIRC, dicts were | ||
# specifically excluded for model fields. Do we need something that restricts | ||
# where fields are valid? | ||
# * Test that type validation is strict. For instance, giving an integer like 644 to | ||
# a field.String() is an error. | ||
class Transaction_ToInstall(Config): | ||
section = TRANSACTION_CFG_SECTION_NAME | ||
name = "to_install" | ||
type_ = fields.List(fields.String(), default=[]) | ||
default = [] | ||
description = """ | ||
List of packages to be added to the upgrade transaction. | ||
Signed packages which are already installed will be skipped. | ||
""" | ||
|
||
|
||
class Transaction_ToKeep(Config): | ||
section = TRANSACTION_CFG_SECTION_NAME | ||
name = "to_keep" | ||
type_ = fields.List(fields.String(), default=[ | ||
"leapp", | ||
"python2-leapp", | ||
"python3-leapp", | ||
"leapp-repository", | ||
"snactor", | ||
]) | ||
default = [ | ||
"leapp", | ||
"python2-leapp", | ||
"python3-leapp", | ||
"leapp-repository", | ||
"snactor", | ||
] | ||
description = """ | ||
List of packages to be kept in the upgrade transaction. The default is | ||
leapp, python2-leapp, python3-leapp, leapp-repository, snactor. If you | ||
override this, remember to include the default values if applicable. | ||
""" | ||
|
||
|
||
class Transaction_ToRemove(Config): | ||
section = TRANSACTION_CFG_SECTION_NAME | ||
name = "to_remove" | ||
type_ = fields.List(fields.String(), default=[ | ||
"initial-setup", | ||
]) | ||
default = ["initial-setup"] | ||
description = """ | ||
List of packages to be removed from the upgrade transaction. The default | ||
is initial-setup which should be removed to avoid it asking for EULA | ||
acceptance during upgrade. If you override this, remember to include the | ||
default values if applicable. | ||
""" |
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
Empty file.