Provide error message on malformed job list
In project and project-template definitions, the existing voluptuous
schema for the jobs in the job list was vs.Any(str, dict). The contents
of the dict itself need to be validated though, the job being a dict
that looks like:
check:
jobs:
- project-test1:
- required-projects:
org/project2
Is invalid as the contents of the build-openstack-sphinx-docs job dict
should themselves be a string or a dict rather than a list. This updates
the error to be:
Zuul encountered a syntax error while parsing its configuration in the
repo org/project on branch master. The error was:
expected str for dictionary value @ data['check']['jobs'][0]['project-test1']
The error appears in the following project stanza:
project:
name: org/project1
check:
jobs:
- project-test1:
- required-projects:
org/project2
in "org/project/.zuul.yaml@master", line 4, column 3
The error, 'expected str for dictionary value' could probably be
improved at some point, but this is at least an error with a message
which is way better than 'Unknown configuration error'.
Split out the attributes of the job in the JobParser voluptuous schema
that can be used in job lists from the ones that can't. For now it's
only name that can't be used.
Also fix a test fixture that had a trailing : in it.
Change-Id: I217eb5d6befbed51b220d47afa18997a87982389
3 files changed