← Back to team overview

openstack team mailing list archive

Re: fake_flags + common breakout

 

On 05/04/2012 11:53 AM, Eric Windisch wrote:
> Russell,
> 
> FYI, with the flags patch, it is no longer possible to set
> rpc-implementation dependent flags in fake_flags.
> 
> Even Rabbit has a flag in there (fake_rabbit), but Rabbit flags are
> currently global, so it works. That won't be true for long… We're going
> to have to fix this.
> 
> One option is to initialize the RPC layer from fake_flags.py and then
> set the options.

Each place that fake_flags is imported, rpc gets initialized first.  See
these lines of code, and the fake_flags import shortly after:

https://github.com/openstack/nova/blob/master/nova/tests/__init__.py#L63
https://github.com/openstack/nova/blob/master/bin/nova-dhcpbridge#L103

> Another option, for now, might just be to push this problem into the
> implementations and have a global "testing" flag that is
> implementation/backend independent. This is uglier on the
> implementation/driver side, but cleaner on the unit tests.  This is
> basically what 'fake_rabbit' is now, anyway.

As far as I can tell, this isn't actually a problem with the uses of
fake_flags right now.  What problem did you hit?

-- 
Russell Bryant


Follow ups

References