diff options
-rw-r--r-- | ogcp/views.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index 579a43f..397831e 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -1064,6 +1064,8 @@ def action_image_restore(): part_id = partition['partition'] if part_id == 0: # This is the disk data, not a partition. continue + if disk_id != 1: + continue part_code = partition['code'] if PART_TYPE_CODES.get(int(part_code), 'UNKNOWN') == 'CACHE': has_cache = True @@ -2444,6 +2446,9 @@ def action_image_create(): if part_type in invalid_part_types: continue + if part.get('disk') != 1: + continue + form.os.choices.append( (f"{part.get('disk')} {part.get('partition')} {part.get('code')}", f"Disk {part.get('disk')} | Partition {part.get('partition')} " @@ -2567,6 +2572,9 @@ def action_image_update(): if part_type in invalid_part_types: continue + if part.get('disk') != 1: + continue + partition_value = f"{part.get('disk')} {part.get('partition')} {part.get('code')}" partition_text = f"Disk {part.get('disk')} | Partition {part.get('partition')} " f"| {PART_TYPE_CODES.get(part.get('code'), 'UNKNOWN')} " |