mirror of https://git.48k.eu/ogcp
views: skip invalid partitions in software inventory
Skip the invalid partition types in the list of selectable partitions in software inventory.master
parent
c6adc0f29b
commit
4e0bb82f9f
|
@ -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')} "
|
||||
|
|
Loading…
Reference in New Issue