views: skip disk data entries in multi-disk clients

Skip partition id zero for the partition list in the software
inventory form.

Partitions of id zero contain disk data and that data is not
relevant to compare client configurations.
master
Alejandro Sirgo Rica 2025-02-10 12:36:19 +01:00
parent c33fe3ca77
commit 91465fc269
1 changed files with 4 additions and 1 deletions

View File

@ -1197,7 +1197,10 @@ def action_software():
flash(_('Software inventory is not available. Boot client in ogLive mode to obtain it'), category='error')
return redirect(url_for('commands'))
for part in r.json()['partitions'][1:]:
for part in r.json()['partitions']:
part_id = part['partition']
if part_id == 0:
continue
form.os.choices.append(
(f"{part.get('disk')} {part.get('partition')}",
f"Disk {part.get('disk')} | Partition {part.get('partition')} "