Remove superfluous try in get_btrfs_info() (#3010)
This commit is contained in:
parent
1d278f8abd
commit
ae3b0f8d75
|
|
@ -239,17 +239,13 @@ class DeviceHandler:
|
||||||
# to the corresponding mountpoints
|
# to the corresponding mountpoints
|
||||||
btrfs_subvol_info = dict(zip(lsblk_info.fsroots, lsblk_info.mountpoints))
|
btrfs_subvol_info = dict(zip(lsblk_info.fsroots, lsblk_info.mountpoints))
|
||||||
|
|
||||||
try:
|
# ID 256 gen 16 top level 5 path @
|
||||||
# ID 256 gen 16 top level 5 path @
|
for line in result.splitlines():
|
||||||
for line in result.splitlines():
|
# expected output format:
|
||||||
# expected output format:
|
# ID 257 gen 8 top level 5 path @home
|
||||||
# ID 257 gen 8 top level 5 path @home
|
name = Path(line.split(' ')[-1])
|
||||||
name = Path(line.split(' ')[-1])
|
sub_vol_mountpoint = btrfs_subvol_info.get(name, None)
|
||||||
sub_vol_mountpoint = btrfs_subvol_info.get(name, None)
|
subvol_infos.append(_BtrfsSubvolumeInfo(name, sub_vol_mountpoint))
|
||||||
subvol_infos.append(_BtrfsSubvolumeInfo(name, sub_vol_mountpoint))
|
|
||||||
except json.decoder.JSONDecodeError as err:
|
|
||||||
error(f"Could not decode lsblk JSON: {result}")
|
|
||||||
raise err
|
|
||||||
|
|
||||||
if not lsblk_info.mountpoint:
|
if not lsblk_info.mountpoint:
|
||||||
self.umount(dev_path)
|
self.umount(dev_path)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue