Comment 1 for bug 1373464

Revision history for this message
Jeffrey Zhang (jeffrey4l) wrote :

I think the way of use oslo.cfg is wrong in current zaqar code.
* The cfg.CONF is a global object. There is no need pass it into every class/object.
* the register_opts should be called when the module imported rather than when the a class is initialed ( it cause this issue ). There is a method `CONF.import_opt` to make sure the register_opts is called before using certain param.
* In the uniitest, there are so many ConfigOpts exist. The ConfigOpts class has set_override and clear_override method, we can use that to override some conf temporarily.

So my suggestion is:
* Remove the pass of cfg.CONF between class/object, just use the global one `cfg.CONF`
* move the register_opts out from class
* Make full advantage of clear_override and set_override method. Remove the extrac instance creation of ConfigOpts in the UnitTest.

Maybe this should create a new bp.