Page MenuHomeSoftware Heritage

Add a simple merge_configs function in config.py
ClosedPublic

Authored by douardda on Mon, Jan 28, 5:29 PM.

Details

Summary

that recursively merge 2 (config) dictionaries.
This is meant to be used to simplify a bit the config system of several
systems of the swh platform (related to T1410 and T826).

depends on D1016

Diff Detail

Repository
rDCORE Foundations and core functionalities
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

douardda created this revision.Mon, Jan 28, 5:29 PM
ardumont accepted this revision.Tue, Jan 29, 10:07 AM
ardumont added a subscriber: ardumont.
ardumont added inline comments.
swh/core/config.py
226

shouldn't it be ...

...
    'key2': value3,
    'key3': value6,
}

I suppose there is an issue with the input instead and the key3 of the second dict should have been key2 instead?

This revision is now accepted and ready to land.Tue, Jan 29, 10:07 AM
douardda marked an inline comment as done.Tue, Jan 29, 10:33 AM
douardda added inline comments.
swh/core/config.py
226

indeed, good catch

vlorentz added inline comments.
swh/core/config.py
226

This could be a doctest

douardda updated this revision to Diff 3235.Tue, Jan 29, 10:35 AM

fix an error in the docstring

This revision was automatically updated to reflect the committed changes.