Remove dynamic_conf
Bug #1373464 reported by
Flavio Percoco
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
zaqar |
In Progress
|
Medium
|
Unassigned |
Bug Description
There's a `dynamic_conf` function used to create a `ConfigOptions` instance at runtime to test pools connectivity and load pool drivers.
I think we should get rid of this function in favor of something more reliable and less "hacky"
tags: | added: storage |
Changed in zaqar: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
assignee: | nobody → Flavio Percoco (flaper87) |
assignee: | Flavio Percoco (flaper87) → nobody |
Changed in zaqar: | |
milestone: | none → kilo-1 |
Changed in zaqar: | |
assignee: | nobody → Jeffrey Zhang (jeffrey4l) |
Changed in zaqar: | |
milestone: | kilo-1 → kilo-2 |
Changed in zaqar: | |
status: | Confirmed → In Progress |
Changed in zaqar: | |
milestone: | kilo-2 → kilo-3 |
Changed in zaqar: | |
assignee: | Jeffrey Zhang (jeffrey4l) → nobody |
Changed in zaqar: | |
milestone: | kilo-3 → kilo-rc1 |
Changed in zaqar: | |
milestone: | kilo-rc1 → none |
milestone: | none → kilo-rc1 |
Changed in zaqar: | |
milestone: | kilo-rc1 → liberty-1 |
Changed in zaqar: | |
milestone: | liberty-1 → liberty-2 |
Changed in zaqar: | |
milestone: | liberty-2 → liberty-3 |
Changed in zaqar: | |
milestone: | liberty-3 → none |
To post a comment you must log in.
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.