Skip to content

Commit

Permalink
Do not crash when we fail to get discoverable GPT type UUID
Browse files Browse the repository at this point in the history
No need to raise an exception if we fail to get the type UUID for
whatever reason.

Related: RHEL-70153
  • Loading branch information
vojtechtrefny committed Dec 5, 2024
1 parent 041b320 commit 22740da
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions blivet/devices/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 22740da

Please sign in to comment.