Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify the fedmsg configuration #425

Open
jeremycline opened this issue Jun 16, 2017 · 4 comments
Open

Simplify the fedmsg configuration #425

jeremycline opened this issue Jun 16, 2017 · 4 comments

Comments

@jeremycline
Copy link
Member

jeremycline commented Jun 16, 2017

This is up for discussion, but I'd like to propose that we start migrating to a simpler configuration format. I think we can do this in a backwards-compatible way (where we support both the new and old method and eventually remove the old method).

What I'd like is:

  1. Use the TOML format loaded with pytoml

  2. Load from ~/.config/fedmsg/config.toml. If it's not present, load from /etc/fedmsg/config.toml. Don't do any fancy merging. Allow for configuration to be specified via the CLI as well, which takes precedence over both those locations.

  3. Configuration is lazy-loaded and not actually read until the configuration dictionary is actually accessed.

  4. Ensure all the defaults are user-friendly and not Fedora-specific.

To use the configuration you just do

>>> from fedmsg import configuration
>>> configuration['zmq_enabled']
True

We can support the old configuration loading (with deprecation warnings) for a while yet and then drop it when the world is ready for the future.

@pypingou
Copy link
Member

Do note that this is going to impact quite some apps, in our control and out of it

@jeremycline
Copy link
Member Author

It'll be backwards compatible and people will have plenty of time to migrate

@glensc
Copy link
Contributor

glensc commented Jun 27, 2017

i like the fact that configuration is in separate files. that allows distribution (rpm) package provide default config. and less pain for sysadmins to merge huge config when some new component is added (distro package with it's own config).

@jeremycline
Copy link
Member Author

That's a good point.

Perhaps a better scheme would be:

If a file is specified on the CLI, use that (and only that) configuration. Otherwise, load all configuration from /etc/fedmsg/conf.d/. If there are duplicate keys in any of the files, report it as an error to the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants