From e7b302c8b8077952a04256084307a44670f69733 Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Tue, 17 May 2022 11:40:07 +0200 Subject: setup disk: fix padding ogServer expects a 4-partition setup. When specifying less than that, the partition setup needs to be padded with EMPTY partitions. Fixes a bug in which this padding is not valid. --- cli/objects/disks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/objects/disks.py b/cli/objects/disks.py index 77955fa..deaf5b3 100644 --- a/cli/objects/disks.py +++ b/cli/objects/disks.py @@ -134,8 +134,9 @@ class OgDisk(): 'format': do_format} payload['partition_setup'].append(part) + last_partnum = int(parsed_args.part[-1][0][0]) # Pad with empty partitions if no 4th part was defined - for i in range(len(parsed_args.part)+1, 5): + for i in range(last_partnum + 1, 5): part = {'partition': str(i), 'code':'EMPTY', 'filesystem': 'EMPTY', 'size': '0', 'format': '0'} -- cgit v1.2.3-18-g5258