Fix partition creation size end (#2858)

This commit is contained in:
codefiles 2024-11-17 17:04:12 -05:00 committed by GitHub
parent 8fc3dc4358
commit 6ca80d1fd7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 18 additions and 13 deletions

View File

@ -236,7 +236,9 @@ class PartitioningList(ListManager):
) -> Size | None: ) -> Size | None:
match = re.match(r'([0-9]+)([a-zA-Z|%]*)', text, re.I) match = re.match(r'([0-9]+)([a-zA-Z|%]*)', text, re.I)
if match: if not match:
return None
str_value, unit = match.groups() str_value, unit = match.groups()
if unit == '%' and start: if unit == '%' and start:
@ -250,10 +252,13 @@ class PartitioningList(ListManager):
return None return None
unit = Unit[unit] if unit else Unit.sectors unit = Unit[unit] if unit else Unit.sectors
return Size(value, unit, sector_size) size = Size(value, unit, sector_size)
if start and size <= start:
return None return None
return size
def _enter_size( def _enter_size(
self, self,
sector_size: SectorSize, sector_size: SectorSize,