cfg: add a global ConfigOpts instance
Nova and Keystone's current usage pattern with cfg is to have a global cfg.ConfigOpts instance in order to simplify access to configuration options.
This pattern was discussed on the mailing list:
https:/
https:/
and at the Folsom design summit.
The benefit of the patterns is that it is simple and concise and does not require a rather tedious exercise in passing a conf object around to all objects in the systen.
While some are somewhat concerned about the inelegance of the pattern, it has served Nova and Keystone well and is fairly common in Python projects.
One of the concerns about the pattern - issues with starting each test run with a clean state - largely is covered by #998396 and now fixed.
We should support this patttern in openstack-common by adding an instance of CommonConfigOpts named CONF in the cfg module namespace. This requires some refactoring to move a bunch of parameters from the
ConfigOpts constructor to the __call__ method.
Blueprint information
- Status:
- Complete
- Approver:
- Mark McLoughlin
- Priority:
- High
- Drafter:
- Mark McLoughlin
- Direction:
- Approved
- Assignee:
- Mark McLoughlin
- Definition:
- Approved
- Series goal:
- Accepted for folsom
- Implementation:
- Implemented
- Milestone target:
- folsom-2
- Started by
- Mark McLoughlin
- Completed by
- Mark McLoughlin
Related branches
Related bugs
Sprints
Whiteboard
Gerrit topic: https:/
Addressed by: https:/
cfg: move constructor args to __call__() args
Addressed by: https:/
cfg: add generators for iterating over all options
Addressed by: https:/
cfg: add a global CONF object
Addressed by: https:/
Add import_opt() method to ConfigOpts