diff --git a/osbuild/formats/v2.py b/osbuild/formats/v2.py index 94da3a7f..c3b32af0 100644 --- a/osbuild/formats/v2.py +++ b/osbuild/formats/v2.py @@ -77,10 +77,12 @@ def describe(manifest: Manifest, *, with_id=False) -> Dict: desc = { "name": mnt.name, "type": mnt.info.name, - "source": mnt.device.name, "target": mnt.target } + if mnt.device: + desc["source"] = mnt.device.name + if mnt.options: desc["options"] = mnt.options return desc