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
master
Javier Hernandez 2024-01-22 10:28:50 +01:00 committed by OpenGnSys Support Team
parent 8cd2f75d51
commit 42f8ea9e40
1 changed files with 4 additions and 0 deletions

View File

@ -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')}",