netapp, nfs, storwize and rbd plugins register opts only after instantiation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Cinder |
Fix Released
|
Medium
|
John Griffith |
Bug Description
Hi,
In most plugins, configuration options are defined prior to the class, then registered directly below the definition, eg:
volume_opts = [
cfg.
....
cfg.
]
FLAGS = flags.FLAGS
FLAGS.register_
class LVMVolumeDriver
...
This practice of registering opts seems to be common across other OpenStack products using oslo.config
However for netapp, nfs, storwize and rbd, the options are registered on instantiation of the class, using self.configurat
I am not a cinder developer, and there may be good reason for this different way of doing things. However, I find the options being registered on import to be quite convenient - and am actually relying on this practice to automatically generate configuration documentation ;)
Thoughts?
Changed in cinder: | |
assignee: | nobody → John Griffith (john-griffith) |
Changed in cinder: | |
milestone: | none → havana-2 |
status: | Fix Committed → Fix Released |
Changed in cinder: | |
milestone: | havana-2 → 2013.2 |
We actually need to switch over to using cfg everywhere properly anyway and at the same time should fix this back up. We started this a while back (using configuration. append in __init__); and I'm not sure our logic on why we needed to do it was actually justified.