From 12335f9e5f3a9d5d77383cd07cde9a888ec6413a Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 22 Nov 2021 12:35:08 +0100 Subject: [PATCH] osbuild-mpp: Be more careful about keys existing In process_embed_files(), it assumed that a stage had a "type" field, which breaks if a stage is e.g. a `mpp-if` node, so use .get() instead of raw dict lookups. --- tools/osbuild-mpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/osbuild-mpp b/tools/osbuild-mpp index bb6e3e89..eb365d06 100755 --- a/tools/osbuild-mpp +++ b/tools/osbuild-mpp @@ -1130,10 +1130,10 @@ class ManifestFileV2(ManifestFile): for stage in pipeline.get("stages", []): for ip in stage.get("inputs", {}).values(): - if ip["type"] != "org.osbuild.files": + if ip.get("type") != "org.osbuild.files": continue - if ip["origin"] != "org.osbuild.source": + if ip.get("origin") != "org.osbuild.source": continue mpp = self.get_mpp_node(ip, "embed")