Skip to content
Snippets Groups Projects
Commit 5f0712f2 authored by Vikram Alagh's avatar Vikram Alagh
Browse files

install: losetup: check if the back-file attribute for a loop device is null

parent 83d6a262
No related branches found
No related tags found
No related merge requests found
......@@ -70,7 +70,7 @@ def device_by_back_file(back_file: Path) -> Path:
# Find the back_file
losetup = json.loads(losetup_output)
for loopdevice in losetup["loopdevices"]:
if Path(loopdevice["back-file"]) == back_file:
if loopdevice["back-file"] is not None and Path(loopdevice["back-file"]) == back_file:
return Path(loopdevice["name"])
raise RuntimeError(f"Failed to find loop device for {back_file}")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment