mirror of https://git.48k.eu/ogcp
views: rename reference partitions variable in /image/restore
Rename part_choices variable to reference_patitioning to improve readability and intent in the code that checks the uniformity of the client's partitions.master
parent
6feffeab5d
commit
d6a896628f
|
@ -1080,7 +1080,7 @@ def action_image_restore():
|
|||
for image in images:
|
||||
form.image.choices.append((image['id'], image['name']))
|
||||
|
||||
part_choices = []
|
||||
reference_patitioning = []
|
||||
empty_clients = []
|
||||
|
||||
invalid_part_types = get_invalid_image_partition_types()
|
||||
|
@ -1124,9 +1124,9 @@ def action_image_restore():
|
|||
if empty_clients:
|
||||
continue
|
||||
|
||||
if not part_choices: # Use first computer as reference part setup conf
|
||||
part_choices = [part for part in parts]
|
||||
elif part_choices != parts:
|
||||
if not reference_patitioning: # Use first computer as reference part setup conf
|
||||
reference_patitioning = [part for part in parts]
|
||||
elif reference_patitioning != parts:
|
||||
flash(_(f'Computers have different partition setup'), category='error')
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
|
@ -1134,7 +1134,7 @@ def action_image_restore():
|
|||
flash(_(f'The following clients have not partitions: {" ".join(empty_clients)}'), category='error')
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
for disk_id, part_id, part_code, filesystem, part_size in part_choices:
|
||||
for disk_id, part_id, part_code, filesystem, part_size in reference_patitioning:
|
||||
form.partition.choices.append(
|
||||
(f"{disk_id} {part_id} {part_code} {part_size} {has_cache}",
|
||||
f"Disk {disk_id} | Partition {part_id} "
|
||||
|
|
Loading…
Reference in New Issue