From d6a896628f1e196acb4479e3ab55655c4f4c1008 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Thu, 26 Sep 2024 14:49:18 +0200 Subject: 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. --- ogcp/views.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ogcp/views.py b/ogcp/views.py index c890782..300bb04 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -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} " -- cgit v1.2.3-18-g5258