Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/archinstall/lib/disk/fido.py
diff options
context:
space:
mode:
authorDaniel Girtler <blackrabbit256@gmail.com>2023-07-25 19:19:14 +1000
committerGitHub <noreply@github.com>2023-07-25 11:19:14 +0200
commita548d7df70102252a557214edc74b77f4859f031 (patch)
tree34fafdea7186d97bcb3043945ee259aa0565eae0 /archinstall/lib/disk/fido.py
parent439bb5428bb6a6f512f695a83ee6b3b8f6537598 (diff)
Fix 1916 (#1920)
* Do not stdout when menu is active * Handle missing libfido2 gracefully * Update --------- Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Diffstat (limited to 'archinstall/lib/disk/fido.py')
-rw-r--r--archinstall/lib/disk/fido.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/archinstall/lib/disk/fido.py b/archinstall/lib/disk/fido.py
index d8c8fd3c..96a74991 100644
--- a/archinstall/lib/disk/fido.py
+++ b/archinstall/lib/disk/fido.py
@@ -7,6 +7,7 @@ from typing import List, Optional
from .device_model import PartitionModification, Fido2Device
from ..general import SysCommand, SysCommandWorker, clear_vt100_escape_codes
from ..output import error, info
+from ..exceptions import SysCallError
class Fido2:
@@ -36,13 +37,13 @@ class Fido2:
# to prevent continous reloading which will slow
# down moving the cursor in the menu
if not cls._loaded or reload:
- ret: Optional[str] = None
try:
- ret = SysCommand("systemd-cryptenroll --fido2-device=list").decode('UTF-8')
- except:
+ ret: Optional[str] = SysCommand("systemd-cryptenroll --fido2-device=list").decode('UTF-8')
+ except SysCallError:
error('fido2 support is most likely not installed')
+ raise ValueError('HSM devices can not be detected, is libfido2 installed?')
+
if not ret:
- error('Unable to retrieve fido2 devices')
return []
fido_devices: str = clear_vt100_escape_codes(ret) # type: ignore