[openstack-dev] [oslo] usage patterns for oslo.config

Brant Knudson blk at acm.org
Wed Aug 27 15:34:39 UTC 2014


Mark -


> I don't think I've seen code (except for obscure cases) which uses the
> CONF global directly (as opposed to being passed CONF as a parameter)
> but doesn't register the options at import time.
>
> Mark.
>
>
Keystone uses the CONF global directly and doesn't register the options at
import time. They're registered early when keystone is started, just before
the call to CONF().

Here's an example use of the CONF global:
http://git.openstack.org/cgit/openstack/keystone/tree/keystone/identity/controllers.py#n48

Here's the function that registers the CONF options:
http://git.openstack.org/cgit/openstack/keystone/tree/keystone/common/config.py#n820

Here's the call to the function that registers the CONF options:
http://git.openstack.org/cgit/openstack/keystone/tree/bin/keystone-all#n115

This was done so that reading the value of a config option during import
will fail.

- Brant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140827/93ea3006/attachment.html>


More information about the OpenStack-dev mailing list