mirror of https://git.48k.eu/ogcp
views: ignore unsuported part types in /image/restore checks
Evaluate only the viable partitions for a restore operation during checks for partition uniformity.master
parent
6fecb9d34b
commit
6feffeab5d
|
@ -1082,6 +1082,9 @@ def action_image_restore():
|
|||
|
||||
part_choices = []
|
||||
empty_clients = []
|
||||
|
||||
invalid_part_types = get_invalid_image_partition_types()
|
||||
|
||||
for ip in ips:
|
||||
r = server.get('/client/setup', payload={'client': [ip]})
|
||||
if not r:
|
||||
|
@ -1101,8 +1104,14 @@ def action_image_restore():
|
|||
if disk_id != 1:
|
||||
continue
|
||||
part_code = partition['code']
|
||||
if PART_TYPE_CODES.get(int(part_code), 'UNKNOWN') == 'CACHE':
|
||||
part_type = PART_TYPE_CODES.get(int(part_code), 'UNKNOWN')
|
||||
|
||||
if part_type == 'CACHE':
|
||||
has_cache = True
|
||||
|
||||
if part_type in invalid_part_types:
|
||||
continue
|
||||
|
||||
filesystem = partition['filesystem']
|
||||
part_size = partition['size']
|
||||
|
||||
|
@ -1125,14 +1134,7 @@ def action_image_restore():
|
|||
flash(_(f'The following clients have not partitions: {" ".join(empty_clients)}'), category='error')
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
invalid_part_types = get_invalid_image_partition_types()
|
||||
|
||||
for disk_id, part_id, part_code, filesystem, part_size in part_choices:
|
||||
part_type = PART_TYPE_CODES.get(int(part_code), 'UNKNOWN')
|
||||
|
||||
if part_type in invalid_part_types:
|
||||
continue
|
||||
|
||||
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