From 5e950907eaf5e33c20cccaa8776aebf325de8e81 Mon Sep 17 00:00:00 2001 From: Radek Vykydal Date: Tue, 3 Sep 2024 16:54:48 +0200 Subject: [PATCH] storage: make _get_windows_data more robust File "/usr/lib/python3.13/site-packages/dasbus/server/handler.py", line 265, in _handle_call return handler(*parameters, **additional_args) File "/usr/lib64/python3.13/site-packages/pyanaconda/modules/storage/devicetree/viewer_interface.py", line 194, in GetExistingSystems return OSData.to_structure_list(self.implementation.get_existing_systems()) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^ File "/usr/lib64/python3.13/site-packages/pyanaconda/modules/storage/devicetree/viewer.py", line 493, in get_existing_systems windows_data = self._get_windows_data() File "/usr/lib64/python3.13/site-packages/pyanaconda/modules/storage/devicetree/viewer.py", line 530, in _get_windows_data if str(device.part_type_uuid) == EFI_PARTITION_TYPE: ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.13/site-packages/blivet/threads.py", line 49, in run_with_lock return m(*args, **kwargs) File "/usr/lib/python3.13/site-packages/blivet/devices/partition.py", line 380, in part_type_uuid if hasattr(parted.Partition, "type_uuid") and self.parted_partition.type_uuid: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'type_uuid' --- pyanaconda/modules/storage/devicetree/viewer.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pyanaconda/modules/storage/devicetree/viewer.py b/pyanaconda/modules/storage/devicetree/viewer.py index 182fae53c4bd..3d9881428671 100644 --- a/pyanaconda/modules/storage/devicetree/viewer.py +++ b/pyanaconda/modules/storage/devicetree/viewer.py @@ -527,12 +527,13 @@ def _get_windows_data(self): continue device = self._get_device(blivet_device.name) - if str(device.part_type_uuid) == EFI_PARTITION_TYPE: - efi_partition = device - continue + if device and device.parted_partition: + if str(device.part_type_uuid) == EFI_PARTITION_TYPE: + efi_partition = device + continue - if str(device.part_type_uuid) in WINDOWS_PARTITION_TYPES: - windows_data.devices.append(device.name) + if str(device.part_type_uuid) in WINDOWS_PARTITION_TYPES: + windows_data.devices.append(device.name) if len(windows_data.devices) > 0: if efi_partition is not None: