diff options
Diffstat (limited to 'ogcp')
-rw-r--r-- | ogcp/views.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ogcp/views.py b/ogcp/views.py index 42dd160..1ce6749 100644 --- a/ogcp/views.py +++ b/ogcp/views.py @@ -831,8 +831,8 @@ def action_image_restore(): form.partition.choices = [ (f"{disk_id} {part_id}", f"Disk {disk_id} | Partition {part_id} " - f"| {PART_TYPE_CODES[part_code]} " - f"{FS_CODES[filesystem]}") + f"| {PART_CODES.get(part_code, 'UNKNOWN')} " + f"{FS_CODES.get(filesystem, 'UNKNOWN')}") for disk_id, part_id, part_code, filesystem in part_choices ] scopes, clients = get_scopes(set(ips)) selected_clients = list(get_selected_clients(scopes['scope']).items()) @@ -926,8 +926,8 @@ def action_software(): form.os.choices.append( (f"{part.get('disk')} {part.get('partition')}", f"Disk {part.get('disk')} | Partition {part.get('partition')} " - f"| {PART_TYPE_CODES[part.get('code')]} " - f"{FS_CODES[part.get('filesystem')]}") + f"| {PART_TYPE_CODES.get(part.get('code'), 'UNKNOWN')} " + f"{FS_CODES.get(part.get('filesystem'), 'UNKNOWN')}") ) return render_template('actions/software.html', form=form, scopes=scopes) @@ -1715,8 +1715,8 @@ def action_image_create(): form.os.choices.append( (f"{part.get('disk')} {part.get('partition')} {part.get('code')}", f"Disk {part.get('disk')} | Partition {part.get('partition')} " - f"| {PART_TYPE_CODES[part.get('code')]} " - f"{FS_CODES[part.get('filesystem')]}") + f"| {PART_TYPE_CODES.get(part.get('code'), 'UNKNOWN')]} " + f"{FS_CODES.get(part.get('filesystem'), 'UNKNOWN')}") ) r = server.get('/client/info', payload={'client': list(ips)}) if not r: @@ -1822,8 +1822,8 @@ def action_image_update(): form.os.choices.append( (f"{part.get('disk')} {part.get('partition')} {part.get('code')}", f"Disk {part.get('disk')} | Partition {part.get('partition')} " - f"| {PART_TYPE_CODES[part.get('code')]} " - f"{FS_CODES[part.get('filesystem')]}") + f"| {PART_TYPE_CODES.get(part.get('code'), 'UNKNOWN')]} " + f"{FS_CODES.get(part.get('filesystem'), 'UNKNOWN')}") ) scopes, _clients = get_scopes(set(ips)) |