no need to use import_opt or import_group if we already import that module
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ceilometer |
Fix Released
|
Low
|
ZhiQiang Fan |
Bug Description
import_opt and import_group will import specified module, which will invoke opt or group registeration, then it try to get specified opt or group from registered options, if fails, NoSuchOpt exception will be raised.
Service can run properly because every service will import ceilometer.service. But if we do not import those opt in the import chain, unit test will be blocked when we run individual test by nosetest (tox seems fix this issue automatically)
IMHO, a common case should be avoid, which is that: we already import that module, and then use cfg.CONF.
But, if it is not so clear, for example, the import or register hides in the middle or the end of the import chain, then duplicate import_opt|group is acceptable, because it is hard for developer to track the import chain just to avoid redundant, and such check will add the burden for reviewers, and maintainers.
A hacking rule may be the best choice, but I'll handle it manually for now
Changed in ceilometer: | |
assignee: | nobody → ZhiQiang Fan (aji-zqfan) |
description: | updated |
Changed in ceilometer: | |
milestone: | none → kilo-2 |
importance: | Undecided → Low |
Changed in ceilometer: | |
status: | Fix Committed → Fix Released |
Changed in ceilometer: | |
milestone: | kilo-2 → 2015.1.0 |
hi ZhiQiang, please reopen, but i don't think this is a ceilometer bug... just a preference... i'm marking as invalid but reopen if you think otherwise