From 7ff45e5fcc497ed9a07056b2401fb6bd9834ea97 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Mon, 3 Jun 2024 15:43:47 +0200 Subject: disk: use proper partition sizes Use base 2 size units for the partition configuration units. Using base 10 units causes incoherency with the web. --- cli/objects/disks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli/objects/disks.py') diff --git a/cli/objects/disks.py b/cli/objects/disks.py index c7315af..f38f420 100644 --- a/cli/objects/disks.py +++ b/cli/objects/disks.py @@ -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: -- cgit v1.2.3-18-g5258