From 91465fc269461825411ea893bdc1f655c8009ed2 Mon Sep 17 00:00:00 2001 From: Alejandro Sirgo Rica Date: Mon, 10 Feb 2025 12:36:19 +0100 Subject: [PATCH] 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. --- ogcp/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ogcp/views.py b/ogcp/views.py index 54b26c8..d2d2b6e 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -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')} "