Skip to content

Make config set options inside the lib module

Colomban Wendling requested to merge b4n/picomon:cleaner-config into master

Instead of depending on config.py defining several magic variables, move the default configuration at the root of the lib module, and make config.py override them as needed.

This prevents config.py from being a required magic part that the user have to write correctly and completely for picomon to work. With this change, config.py still can do anything it want, but the other parts of the code don't completely depend on it defining some variables out of the blue.

This gives us default values for the settings where appropriate, which allows seamless upgrade paths in practice, as a config.py from an older version is likely to work for a new one (unless of course some new, default on, feature requires a non-default configuration value).


It may feel more natural if the lib module was renamed to picomon as setting picomon.checks might be more explicit than lib.checks, but it is a little outside the scope of this change and should be done separately if at all.

Merge request reports

Loading