formats/v2: fix describe for mount without source
Commit 5b1cd2b made `source` and `target` for mounts optional, but
the corresponding code in `describe` still assumes that the device
will always be present. Fix this so that source will only be used
if it is set.
This commit is contained in:
parent
52cb27631b
commit
e63fa48504
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue