Merge pull request #936 from hegner/bugfix/configsections

Improve error message for wrong config section names
This commit is contained in:
Todd Gamblin 2016-05-11 08:58:33 -07:00
commit eaf046c6a4

View File

@ -269,10 +269,10 @@
def validate_section_name(section):
"""Raise a ValueError if the section is not a valid section."""
"""Exit if the section is not a valid section."""
if section not in section_schemas:
raise ValueError("Invalid config section: '%s'. Options are %s"
% (section, section_schemas))
tty.die("Invalid config section: '%s'. Options are: %s"
% (section, " ".join(section_schemas.keys())))
def extend_with_default(validator_class):