Compare commits

..

No commits in common. "master" and "v1.1.3-40" have entirely different histories.

1 changed files with 15 additions and 11 deletions

View File

@ -774,6 +774,10 @@ 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)
@ -1108,6 +1112,10 @@ 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}",
@ -1116,6 +1124,10 @@ 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)
@ -1181,28 +1193,20 @@ def action_software():
server = get_server_from_clients(ips)
r = server.get('/client/setup', payload={'client': list(ips)})
invalid_part_types = get_invalid_image_partition_types()
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']:
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'])