oslo.config print_help() and print_usage() crash or are not "useful"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
oslo-incubator |
Fix Released
|
Medium
|
Davanum Srinivas (DIMS) |
Bug Description
Adapting the "common usage pattern in OpenStack" cited in [1]:
from oslo.config import cfg
opts = [
]
CONF = cfg.CONF
CONF.
Attempts to call "CONF.print_
Traceback (most recent call last):
File "demo.py", line 19, in <module>
File "[...]/
AttributeError: 'NoneType' object has no attribute 'print_help'
This member is set via three public methods:
+ ConfigOpts.reset() or ConfigOpts.clear() [reset calls clear]
+ calling the ConfigOpts object itself
In the first bullet immediately above there is not much beyond the default -h to report in the help or usage message afterwards. In the second case, a call to the object itself triggers the processing of the command line options which will then respond to the necessity of a help or usage message itself precluding the need (or even the opportunity) for the main program to call these functions.
---
[1] http://
summary: |
- oslo.config print_help and print_usage not "useful" + oslo.config print_help() and print_usage() crash or are not "useful" |
Changed in oslo: | |
milestone: | none → havana-2 |
assignee: | nobody → Davanum Srinivas (DIMS) (dims-v) |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in oslo: | |
status: | Fix Committed → Fix Released |
Changed in oslo: | |
milestone: | havana-2 → 2013.2 |
Andrew - could you go into some more detail about why exactly you want to print help/usage before parsing the command line?