[openstack-dev] [nova][oslo] oslo.config and import chains

Kevin L. Mitchell kevin.mitchell at rackspace.com
Thu Aug 7 17:50:17 UTC 2014


On Thu, 2014-08-07 at 17:44 +0100, Matthew Booth wrote:
> These are tricky, case-by-case workarounds to a general problem which
> can be solved by simply calling register_opts() in a place where it's
> guaranteed to be safe. 

No, THE CODE IS WRONG.  It is evaluating a configuration value at
_module load time_ rather than at run time.  It is wrong for the same
reason that "def foo(arg={})" is wrong.  If you fix the time at which
evaluation occurs, importing is no longer a problem.

> Is there any reason not to call register_opts()
> before importing other modules?

-- 
Kevin L. Mitchell <kevin.mitchell at rackspace.com>
Rackspace




More information about the OpenStack-dev mailing list