summaryrefslogtreecommitdiffstats
path: root/ogcp/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'ogcp/views.py')
-rw-r--r--ogcp/views.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/ogcp/views.py b/ogcp/views.py
index 097041f..3ceffdf 100644
--- a/ogcp/views.py
+++ b/ogcp/views.py
@@ -2309,25 +2309,37 @@ def action_image_update():
invalid_part_types = get_invalid_image_partition_types()
+ part_content = {}
for part in r.json()['partitions'][1:]:
part_type = PART_TYPE_CODES.get(int(part.get('code')), 'UNKNOWN')
if part_type in invalid_part_types:
continue
+ partition_value = f"{part.get('disk')} {part.get('partition')} {part.get('code')}"
+ partition_text = 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')}"
+
form.os.choices.append(
- (f"{part.get('disk')} {part.get('partition')} {part.get('code')}",
+ (partition_value,
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 part['image']:
+ for image in images[repo_id]:
+ if image['id'] == part['image']:
+ part_content[partition_value] = part['image']
+ break
+
scopes, _clients = get_scopes(set(ips))
selected_clients = list(get_selected_clients(scopes['scope']).items())
return render_template('actions/image_update.html', form=form,
selected_clients=selected_clients,
- scopes=scopes)
+ scopes=scopes, part_content=part_content)
@app.route('/action/reboot', methods=['GET', 'POST'])