diff options
Diffstat (limited to 'ogcp/views.py')
-rw-r--r-- | ogcp/views.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index fde7590..77402d6 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -659,24 +659,24 @@ def action_setup_modify(): 'cache_size': str(0), 'partition_setup': []} - required_partitions = ["1", "2", "3", "4"] + partition_index = 0 + for partition in form.partitions: - print(partition) - partition_setup = {'partition': str(partition.partition.data), + partition_index += 1 + partition_setup = {'partition': str(partition_index), 'code': str(partition.part_type.data), 'filesystem': str(partition.fs.data), 'size': str(partition.size.data * 1024), 'format': str(int(partition.format_partition.data))} payload['partition_setup'].append(partition_setup) - if partition.partition.data in required_partitions: - required_partitions.remove(partition.partition.data) + if partition.part_type.data == 'CACHE': payload['cache'] = '1' payload['cache_size'] = str(partition.size.data * 1024) - for partition in required_partitions: + for partition_index in range(len(form.partitions) + 1, 5): empty_part = { - 'partition': partition, + 'partition': str(partition_index), 'code': 'EMPTY', 'filesystem': 'EMPTY', 'size': '0', |