[Openstack] [RFC] Common config options module

Mark McLoughlin markmc at redhat.com
Wed Dec 7 07:26:52 UTC 2011

On Mon, 2011-12-05 at 15:32 -0800, Andy Smith wrote:
> Took a look over the wiki for this. The approach is very similar to one
> I've used recently so I wanted to bring up something that looks like it may
> have been overlooked.
> In testing it is frequent practice that you want to ensure global config
> state and somehow overwrite global config state on the fly (for example
> when you have dynamic ports being assigned to a service), passing config
> dicts around everywhere makes this task a bit harder. My solution was to
> force all instances being handed an options dict to assign it to the
> .options attribute on itself, and to use a common name for chained
> applications so that it is possible to traverse the tree:
> https://github.com/termie/keystonelight/blob/master/keystonelight/test.py#L107

Glance already was passing a config dict around so, for tests, I found
it quite handy to have a little helper which actually wrote out a
temporary config file with overrides:


With Nova, it'll be quite a challenge to get to a point where we're not
using a global variable for accessing config. For Nova tests, I added
set_default() and set_override() methods:



More information about the Openstack mailing list