mirror of https://git.48k.eu/ogcp
Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
|
4e0bb82f9f | |
|
c6adc0f29b | |
|
35269b31a7 | |
|
1cf6fbc49e |
|
@ -774,10 +774,6 @@ def action_setup_show():
|
|||
|
||||
setup_data = get_client_setup(base_client)
|
||||
|
||||
if not setup_data:
|
||||
flash(_('Partition information is not available. Boot client in ogLive mode to obtain it'), category='error')
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
selected_disk = 1
|
||||
common_disk_data = get_common_disk_data(ips)
|
||||
|
||||
|
@ -1112,10 +1108,6 @@ def action_image_restore():
|
|||
|
||||
reference_patitioning = part_collection.get_partition_setup(0)
|
||||
|
||||
if not reference_patitioning:
|
||||
flash(_(f'No valid partition found'), category='error')
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
for disk_id, part_id, part_type, fs_type, part_size in reference_patitioning:
|
||||
form.partition.choices.append(
|
||||
(f"{disk_id} {part_id} {part_size} {has_cache}",
|
||||
|
@ -1124,10 +1116,6 @@ def action_image_restore():
|
|||
f"{fs_type}")
|
||||
)
|
||||
|
||||
if not form.partition.choices:
|
||||
flash(_(f'No valid partition available'), category='error')
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
return render_template('actions/image_restore.html', form=form,
|
||||
selected_clients=selected_clients,
|
||||
scopes=scopes)
|
||||
|
@ -1193,20 +1181,28 @@ 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'))
|
||||
invalid_part_types = get_invalid_image_partition_types()
|
||||
|
||||
for part in r.json()['partitions']:
|
||||
part_id = part['partition']
|
||||
if part_id == 0:
|
||||
continue
|
||||
|
||||
part_type = PART_TYPE_CODES.get(int(part.get('code')), 'UNKNOWN')
|
||||
if part_type in invalid_part_types:
|
||||
continue
|
||||
|
||||
form.os.choices.append(
|
||||
(f"{part.get('disk')} {part.get('partition')}",
|
||||
f"Disk {part.get('disk')} | Partition {part.get('partition')} "
|
||||
f"| {PART_TYPE_CODES.get(part.get('code'), 'UNKNOWN')} "
|
||||
f"{FS_CODES.get(part.get('filesystem'), 'UNKNOWN')}")
|
||||
)
|
||||
|
||||
if not form.os.choices:
|
||||
flash(_(f'No valid partition available'), category='error')
|
||||
return redirect(url_for('commands'))
|
||||
|
||||
return render_template('actions/software.html', form=form, scopes=scopes)
|
||||
|
||||
@app.route('/action/session', methods=['GET', 'POST'])
|
||||
|
|
Loading…
Reference in New Issue