#56 Fix loading the configuration when running pdc_import_compose manually
Merged 3 years ago by pingou. Opened 3 years ago by pingou.

@@ -384,6 +384,10 @@ 

      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 @@ 

          )

  

      PDCImportCompose().process(

-         config=config.get("consumer_config", {}).get("pdc_import_compose", {}),

+         config=parsed_config,

          message=message,

      )

  

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 pingou@pingoured.fr

Pull-Request has been merged by pingou

3 years ago

Build succeeded.

  • tox : SUCCESS in 6m 07s