meta: show stage name when schema is missing

Show the stage name (if one is set) when failing the stage in the
validator. This closes #1007, example output:

```
€ python3 -m osbuild supakeen-os.json
supakeen-os.json has errors:

pipelines[0].stages[0]
  could not find schema information for 'org.osbuild.rpmb'

  .pipelines[0].stages[0].inputs.packages:
    could not find schema information for 'org.osbuild.filesz'
```
This commit is contained in:
Simon de Vlieger 2022-05-11 13:24:37 +02:00 committed by Christian Kellner
parent f23ec6eebe
commit 6997cff9c0

View file

@ -232,7 +232,13 @@ class Schema:
return res
if not self.data:
res.fail("missing schema information")
msg = "could not find schema information"
if self.name:
msg += f" for '{self.name}'"
res.fail(msg)
return res
try: