From 837d06b916549e8a22e90f2495384c2e029874ff Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Tue, 17 Sep 2024 23:29:13 -0700 Subject: [PATCH] Add a second copy of rpm.py config to see if it is recognized in the common diretory. --- repos/system_upgrade/common/configs/rpm.py | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 repos/system_upgrade/common/configs/rpm.py diff --git a/repos/system_upgrade/common/configs/rpm.py b/repos/system_upgrade/common/configs/rpm.py new file mode 100644 index 0000000000..463640cc08 --- /dev/null +++ b/repos/system_upgrade/common/configs/rpm.py @@ -0,0 +1,64 @@ +""" +Configuration keys for dnf transactions. +""" + +from leapp.actors.configs import Config +from leapp.models import fields + + +# * 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. + """