views: skip invalid partitions in software inventory

Skip the invalid partition types in the list of selectable
partitions in software inventory.
master
Alejandro Sirgo Rica 2025-02-14 12:04:14 +01:00
parent c6adc0f29b
commit 4e0bb82f9f
1 changed files with 7 additions and 0 deletions

View File

@ -1181,10 +1181,17 @@ def action_software():
server = get_server_from_clients(ips)
r = server.get('/client/setup', payload={'client': list(ips)})
invalid_part_types = get_invalid_image_partition_types()
for part in r.json()['partitions']:
part_id = part['partition']
if part_id == 0:
continue
part_type = PART_TYPE_CODES.get(int(part.get('code')), 'UNKNOWN')
if part_type in invalid_part_types:
continue
form.os.choices.append(
(f"{part.get('disk')} {part.get('partition')}",
f"Disk {part.get('disk')} | Partition {part.get('partition')} "