From 22740da280258990d557eb45ac90d86c4f821c05 Mon Sep 17 00:00:00 2001 From: Vojtech Trefny Date: Thu, 5 Dec 2024 14:31:15 +0100 Subject: [PATCH] Do not crash when we fail to get discoverable GPT type UUID No need to raise an exception if we fail to get the type UUID for whatever reason. Related: RHEL-70153 --- blivet/devices/partition.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/blivet/devices/partition.py b/blivet/devices/partition.py index 2d67be81f..89470d9fb 100644 --- a/blivet/devices/partition.py +++ b/blivet/devices/partition.py @@ -365,10 +365,16 @@ def part_type_uuid_req(self): hasattr(parted.Partition, "type_uuid")) if discoverable: - parttype = gpt_part_uuid_for_mountpoint(self._mountpoint) - log.debug("Discovered partition type UUID %s for mount '%s'", - parttype, self._mountpoint) - return parttype + try: + parttype = gpt_part_uuid_for_mountpoint(self._mountpoint) + except errors.GPTVolUUIDError as e: + log.error("Failed to get partition type UUID for mount '%s': %s", + self._mountpoint, str(e)) + return None + else: + log.debug("Discovered partition type UUID %s for mount '%s'", + parttype, self._mountpoint) + return parttype return None @property