Skip to content

Commit

Permalink
Merge pull request #1298 from vojtechtrefny/main_fsminsize-check-fix
Browse files Browse the repository at this point in the history
Do not raise libblockdev errors in FSMinSize tasks (#2314637)
  • Loading branch information
vojtechtrefny authored Sep 26, 2024
2 parents 85785ce + 4c03ebd commit 83c7ff8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions blivet/tasks/fsminsize.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ def do_task(self): # pylint: disable=arguments-differ
if error_msgs:
raise FSError("\n".join(error_msgs))

return Size(BlockDev.fs.ext2_get_min_size(self.fs.device))
try:
min_size = Size(BlockDev.fs.ext2_get_min_size(self.fs.device))
except BlockDev.FSError as e:
raise FSError("failed to get fs min size: %s" % e)
return min_size


class NTFSMinSize(FSMinSize):
Expand All @@ -69,7 +73,11 @@ def do_task(self): # pylint: disable=arguments-differ
if error_msgs:
raise FSError("\n".join(error_msgs))

return Size(BlockDev.fs.ntfs_get_min_size(self.fs.device))
try:
min_size = Size(BlockDev.fs.ntfs_get_min_size(self.fs.device))
except BlockDev.FSError as e:
raise FSError("failed to get fs min size: %s" % e)
return min_size


class UnimplementedFSMinSize(fstask.UnimplementedFSTask):
Expand Down

0 comments on commit 83c7ff8

Please sign in to comment.