summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/config.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/spack/spack/config.py b/lib/spack/spack/config.py
index 21e08ff666..9488e49ab9 100644
--- a/lib/spack/spack/config.py
+++ b/lib/spack/spack/config.py
@@ -269,10 +269,10 @@ config_scopes = OrderedDict()
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):