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.
This commit is contained in:
Alexander Larsson 2021-11-22 12:35:08 +01:00 committed by Tom Gundersen
parent bfa619f1a2
commit 12335f9e5f

View file

@ -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")