summaryrefslogtreecommitdiffstats
path: root/src/live/ogOperations.py
diff options
context:
space:
mode:
authorAlejandro Sirgo Rica <asirgo@soleta.eu>2024-09-12 14:08:53 +0200
committerAlejandro Sirgo Rica <asirgo@soleta.eu>2024-09-25 14:35:41 +0200
commit51258613cc07ca8f6def8d0d15f6152d85a4c652 (patch)
tree170667a5772d915e29c89881c273e1c6c5784411 /src/live/ogOperations.py
parent11a963c70930405cb94d222ec5a55b1e5000bcb4 (diff)
src: verify the fields of the efibootmgr json in /refresh
Don't send the efi data in the /refresh payload if efibootmgr is missing any of the json keys. Log the missing keys in case of missing some.
Diffstat (limited to 'src/live/ogOperations.py')
-rw-r--r--src/live/ogOperations.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/live/ogOperations.py b/src/live/ogOperations.py
index 9c32cce..c51215c 100644
--- a/src/live/ogOperations.py
+++ b/src/live/ogOperations.py
@@ -164,7 +164,7 @@ class OgLiveOperations:
return data
try:
- efibootmgr_out = run_efibootmgr_json()
+ efibootmgr_out = run_efibootmgr_json(validate=True)
except Exception as e:
logging.warning(e)
return data
@@ -172,8 +172,8 @@ class OgLiveOperations:
data['entries'] = []
for idx, entry_name in enumerate(efibootmgr_out['BootOrder']):
entry_name = 'Boot' + entry_name
- for entry in efibootmgr_out['vars']:
- if entry['name'] == entry_name:
+ for entry in efibootmgr_out.get('vars', []):
+ if entry.get('name', '') == entry_name:
entry['order'] = idx
data['entries'].append(entry)
break