summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Hernandez <jhernandez@soleta.eu>2024-01-22 10:28:50 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2024-01-22 11:15:00 +0100
commit42f8ea9e40c703d8a51f1b04f7bdec9d69703edb (patch)
tree852d275294d34fbc18343cc112ab2972700b7d85
parent8cd2f75d5166bd03011883979fad8adf04230ec9 (diff)
views: Display error if software inventory are not available
Display an error if the user tries to view software inventory but it is yet not available
-rw-r--r--ogcp/views.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 41dbf3c..f7201c7 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -805,6 +805,10 @@ def action_software():
server = get_server_from_clients(ips)
r = server.get('/client/setup', payload={'client': list(ips)})
+ if not r.json()['partitions']:
+ 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:]:
form.os.choices.append(
(f"{part.get('disk')} {part.get('partition')}",