Remove dynamic_conf

Bug #1373464 reported by Flavio Percoco on 2014-09-24
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zaqar
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
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.

Flavio Percoco (flaper87) wrote :

Hey Jeffrey,

I'm really sorry for the confusion, I know by looking at other openstack's projects it may seem that global config objects are the way to go, although they're exactly what we're trying to move away from.

Zaqar's somewhere in the middle because we depend (use to?) on some 'libraries' that required this global config object to exist. I've a work-in-progress patch that should get rid of the global config and allow us to completely rely on something local without side-effects.

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

Change abandoned by Jeffrey Zhang (<email address hidden>) on branch: master
Review: https://review.openstack.org/132959

Thierry Carrez (ttx) on 2015-06-23
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.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers