Page MenuHomeSoftware Heritage

Refactor config handling in cli.py
ClosedPublic

Authored by douardda on Jan 29 2019, 3:09 PM.

Details

Summary

Move the config file loading in the main cli group so that every
command in this group have a consistent config loading behavior.

This means that some cli commands "signatures" have changed:

  • every command now accepts a -C/--config-file option
  • the --cls has been dropped: either you give a config file, or passing a --database or --url option determine the 'class' of backend to use,
  • the api-server command 'config-path' argument has been dropped (use --config-file instead),

Also remove the main function from listener.py, it's now in cli.py

And make configuration of SWHElasticSearchClient use an explicit and consistent
behavior instead of looking the config file for this entity in a hard to find
dedicated file, expect a config object (dict) as constructor kwargs and look
for its config under the 'elasticsearch' section.

Move sheduler's default conf in swh.scheduler

Diff Detail

Repository
rDSCH Scheduling utilities
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

This revision is now accepted and ready to land.Jan 29 2019, 5:06 PM
This revision was automatically updated to reflect the committed changes.