mirror of https://git.48k.eu/ogcp
views: restrict image restore update and create to disk 1
Keep restore update and create image operations restricted to the first disk as enabling it for multiple disk is untested and requires more work.master
parent
d00e437b8d
commit
b433d84095
|
@ -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')} "
|
||||
|
|
Loading…
Reference in New Issue