From f5f8771b6f7aa6ff37dd688085133b28b4bf5f57 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Thu, 14 Nov 2024 15:14:36 +0100 Subject: grub: fix failed grub configuration when a device is not found Fix "No medium found" error aborting the grub configuration process. Just log it and continue. --- src/utils/grub.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/utils') diff --git a/src/utils/grub.py b/src/utils/grub.py index 4b403db..c254193 100644 --- a/src/utils/grub.py +++ b/src/utils/grub.py @@ -266,7 +266,10 @@ def _get_os_entries(esp_mountpoint): available_disks = get_disks() for disk_num, diskname in enumerate(available_disks, start=1): disk_device = f'/dev/{diskname}' - partitions_data = get_partition_data(device=disk_device) + try: + partitions_data = get_partition_data(device=disk_device) + except OgError as e: + continue for p in partitions_data: part_num = p.partno + 1 -- cgit v1.2.3-18-g5258