summaryrefslogtreecommitdiffstats
path: root/cli/objects
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2022-05-17 11:40:07 +0200
committerJose M. Guisado <jguisado@soleta.eu>2022-05-17 11:40:07 +0200
commite7b302c8b8077952a04256084307a44670f69733 (patch)
tree1c9b9300dabb4f9aecb413d39116399ab4b5f5e5 /cli/objects
parentb765ee50d31b1b629b7572c231d2cf2840a4146f (diff)
setup disk: fix paddingv0.1
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.
Diffstat (limited to 'cli/objects')
-rw-r--r--cli/objects/disks.py3
1 files changed, 2 insertions, 1 deletions
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'}