From 033588c6b9888228c0bff6dabb52d6bd595e60cf Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 27 2020 20:12:23 +0000 Subject: Fix loading the configuration when running pdc_import_compose manually The config is a mix of the default configuration together with the toddler specific configuration and since this toddler shares some configuration information with other toddlers, some of the information it needs are in the 'default' section. So compile the configuration needed from both places. Signed-off-by: Pierre-Yves Chibon --- diff --git a/toddlers/plugins/pdc_import_compose.py b/toddlers/plugins/pdc_import_compose.py index 2ff2230..d4a7d33 100644 --- a/toddlers/plugins/pdc_import_compose.py +++ b/toddlers/plugins/pdc_import_compose.py @@ -384,6 +384,10 @@ def main(args): setup_logging(log_level=args.log_level) config = toml.load(args.conf) + parsed_config = config.get("consumer_config", {}).get("default", {}) + parsed_config.update( + config.get("consumer_config", {}).get("pdc_import_compose", ()) + ) with open(args.json_message) as stream: message = fedora_messaging.api.Message( @@ -391,7 +395,7 @@ def main(args): ) PDCImportCompose().process( - config=config.get("consumer_config", {}).get("pdc_import_compose", {}), + config=parsed_config, message=message, )