-
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.
Initial work to demonstrate an actor config framework.
* Modify the upgrade workflow to load the actor configuration to be available to the actors [_] Note: The same sort of code needs to be added to other workflows that need actor config. For instance, the pre-upgrade workflow. * Define potential config schemas for RHUI and for listing rpm packages to be treated specially during transations. * Add config schemas to the rpmtransactionconfigtaskscollector as a sample of using it. Depends-On: 870
- Loading branch information
Showing
6 changed files
with
165 additions
and
6 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
Empty file.
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,81 @@ | ||
""" | ||
Configuration keys for RHUI. | ||
In case of RHUI in private regions it usual that publicly known RHUI data | ||
is not valid. In such cases it's possible to provide the correct expected | ||
RHUI data to correct the in-place upgrade process. | ||
""" | ||
|
||
from leapp.models import fields | ||
from leapp.actors.configs import Config | ||
|
||
|
||
class RhuiSrcPkg(Config): | ||
section = "rhui" | ||
name = "src_pkg" | ||
type_ = fields.String(default="rhui") | ||
default = "rhui" | ||
description = """ | ||
The name of the source RHUI client RPM (installed on the system). | ||
Default: rhui. | ||
""" | ||
|
||
|
||
class RhuiTargetPkg(Config): | ||
section = "rhui" | ||
name = "target_pkg" | ||
type_ = fields.String(default="rhui") | ||
default = "rhui" | ||
description = """ | ||
The name of the target RHUI client RPM (to be installed on the system). | ||
Default: rhui | ||
""" | ||
|
||
|
||
class RhuiLeappRhuiPkg(Config): | ||
section = "rhui" | ||
name = "leapp_rhui_pkg" | ||
type_ = fields.String(default="leapp-rhui") | ||
default = "leapp-rhui" | ||
description = """ | ||
The name of the leapp-rhui RPM. Default: leapp-rhui | ||
""" | ||
|
||
|
||
class RhuiLeappRhuiPkgRepo(Config): | ||
section = "rhui" | ||
name = "leapp_rhui_pkg_repo" | ||
type_ = fields.String(default="rhel-base") | ||
default = "rhel-base" | ||
description = """ | ||
The repository ID containing the specified leapp-rhui RPM. | ||
Default: rhel-base | ||
""" | ||
|
||
|
||
all_rhui_cfg = (RhuiSrcPkg, RhuiTargetPkg, RhuiLeappRhuiPkg, RhuiLeappRhuiPkg) | ||
# Usage: from configs import rhui | ||
# class MyActor: | ||
# [...] | ||
# configs = all_rhui_cfg + (MyConfig,) | ||
|
||
# TODO: We need to implement fields.Map before this can be enabled | ||
''' | ||
class RhuiFileMap(Config): | ||
section = "rhui" | ||
name = "file_map" | ||
type_ = fields.Map(fields.String()) | ||
description = """ | ||
Define directories to which paritcular files provided by the leapp-rhui | ||
RPM should be installed. The files in 'files_map' are provided by | ||
special Leapp rpms (per cloud) and are supposed to be delivered into the | ||
repos/system_upgrade/common/files/rhui/<PROVIDER> directory. | ||
These files are usually needed to get access to the target system repositories | ||
using RHUI. Typically these are certificates, keys, and repofiles with the | ||
target RHUI repositories. | ||
The key is the name of the file, the value is the expected directory | ||
where the file should be installed on the upgraded system. | ||
""" | ||
''' |
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,64 @@ | ||
""" | ||
Configuration keys for dnf transactions. | ||
""" | ||
|
||
from leapp.models import fields | ||
from leapp.actors.configs import Config | ||
|
||
|
||
# * 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" | ||
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" | ||
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" | ||
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. | ||
""" |