disk: use proper partition sizes

Use base 2 size units for the partition configuration units.
Using base 10 units causes incoherency with the web.
master
Alejandro Sirgo Rica 2024-06-03 15:43:47 +02:00
parent 10d7b972ca
commit 7ff45e5fcc
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ class OgDisk():
def setup_disk(rest, args):
def parse_size(size):
size = size.upper()
units = {"M": 10**3, "G": 10**6, "T": 10**9} # Mapped to K
units = {"M": 1024, "G": 1024**2, "T": 1024**3} # Mapped to K
# size = re.sub(r'(\d+)([MGT])', r'\1 \2', size)
match = re.match(r'(\d+)([MGT])', size)
if match: