From ebc845c3da9830d850b4af2bfe630e71564d86fa Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Thu, 12 Sep 2024 01:59:44 -0700 Subject: [PATCH] Try to fix retrieval of the configuration schemas from the actors. Depends-On: 870 --- commands/upgrade/__init__.py | 3 ++- repos/system_upgrade/common/configs/rpm.py | 12 ++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/commands/upgrade/__init__.py b/commands/upgrade/__init__.py index 5826f458cb..0de7148ced 100644 --- a/commands/upgrade/__init__.py +++ b/commands/upgrade/__init__.py @@ -94,7 +94,8 @@ def upgrade(args, breadcrumbs): # Read the Actor Config and validate it against the schemas saved in the # configuration. - actor_config_schemas = repositories.get_config_schemas() + actor_config_schemas = tuple(actor.config_schemas for actor in repositories.actors) + actor_config_schemas = actor_config.normalize_schemas(actor_config_schemas) actor_config_path = cfg.get('actor_config', 'path') # Note: actor_config.load() stores the loaded actor config into a global # variable which can then be accessed by functions in that file. Is this diff --git a/repos/system_upgrade/common/configs/rpm.py b/repos/system_upgrade/common/configs/rpm.py index 99baa69fee..96bac1bcc0 100644 --- a/repos/system_upgrade/common/configs/rpm.py +++ b/repos/system_upgrade/common/configs/rpm.py @@ -6,10 +6,14 @@ 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. +# * 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"