Improved error message when failing to detect mount information.

This commit is contained in:
Anton Hvornum 2021-11-16 14:06:02 +00:00
parent 1168efb01e
commit 29aa991ab5
1 changed files with 4 additions and 2 deletions

View File

@ -186,8 +186,10 @@ class Installer:
mountpoints[mountpoint]['device_instance'].mount(f"{self.target}{mountpoint}")
time.sleep(1)
if not get_mount_info(f"{self.target}{mountpoint}", traverse=False):
raise DiskError(f"Target {self.target}{mountpoint} never got mounted properly.")
try:
get_mount_info(f"{self.target}{mountpoint}", traverse=False)
except DiskError as err:
raise DiskError(f"Target {self.target}{mountpoint} never got mounted properly (unable to get mount information using findmnt).")
if (subvolumes := mountpoints[mountpoint].get('btrfs', {}).get('subvolumes', {})):
for name, location in subvolumes.items():