Fix partition creation size end (#2858)
This commit is contained in:
parent
8fc3dc4358
commit
6ca80d1fd7
|
|
@ -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,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue