From 5891beab4e2d850c144cee3e16f33a4df28a8b90 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Fri, 29 May 2020 15:56:40 +0200 Subject: [PATCH] meta: also validate the schema for sources When validating the manifest, now also validate the schema for the supplied sources. --- osbuild/meta.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osbuild/meta.py b/osbuild/meta.py index d08332b9..81e37e73 100644 --- a/osbuild/meta.py +++ b/osbuild/meta.py @@ -473,4 +473,11 @@ def validate(manifest: Dict, index: Index) -> ValidationResult: res = schema.validate(asm) result.merge(res, path=["pipeline", "assembler"]) + # sources + sources = manifest.get("sources", {}) + for name, source in sources.items(): + schema = index.get_schema("Source", name) + res = schema.validate(source) + result.merge(res, path=["sources", name]) + return result