fatal kwarg on option does not allow --help on cli for non existing config files

Bug #757955 reported by s0undt3ch
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
configglue
Fix Released
Undecided
Ricardo Kirkner

Bug Description

When an option in a schema has the fatal kwarg set to True, we cannot issue a `--help` on the console, raises ConfigParser.NoOptionError.
This happens while there's no config file yet.

This should only happen if not passing `--help` and should be raised in a cleaner way, not something like:
Traceback (most recent call last):
  File "tests/cfglue_test.py", line 65, in <module>
    op, opts, args = schemaconfigglue(scp)
  File "/home/vampas/projects/.virtual_python/lib/python2.6/site-packages/configglue/pyschema/glue.py", line 62, in schemaconfigglue
    kwargs['default'] = parser.get(section.name, option.name)
  File "/home/vampas/projects/.virtual_python/lib/python2.6/site-packages/configglue/pyschema/parser.py", line 457, in get
    raw, vars)
  File "/usr/lib/python2.6/ConfigParser.py", line 541, in get
    raise NoOptionError(option, section)
ConfigParser.NoOptionError: No option 'network' in section: '__main__

Related branches

Revision history for this message
s0undt3ch (ufs) wrote :

Seems that like this we can't event write a default config file with the basic schema defaults.

Changed in configglue:
status: New → In Progress
assignee: nobody → Ricardo Kirkner (ricardokirkner)
Changed in configglue:
status: In Progress → Fix Committed
Changed in configglue:
milestone: none → 0.11
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.