From 42f8ea9e40c703d8a51f1b04f7bdec9d69703edb Mon Sep 17 00:00:00 2001 From: Javier Hernandez Date: Mon, 22 Jan 2024 10:28:50 +0100 Subject: 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 --- ogcp/views.py | 4 ++++ 1 file changed, 4 insertions(+) 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')}", -- cgit v1.2.3-18-g5258