← Back to team overview

configglue team mailing list archive

[Bug 757955] [NEW] fatal kwarg on option does not allow --help on cli for non existing config files

 

Public bug reported:

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__

** Affects: configglue
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of
Configglue developers, which is the registrant for configglue.
https://bugs.launchpad.net/bugs/757955

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

Status in configglue:
  New

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__



Follow ups

References