From a48b8fdc18a654cfe6b4d7cfefecd9338b623c55 Mon Sep 17 00:00:00 2001 From: Date Huang Date: Fri, 8 Nov 2024 21:19:03 +0800 Subject: [PATCH] T6861: op-mode: ignore error code 255 if this UEFI doesn't support secure boot `mokutil --sb-state` will output "This system doesn't support Secure Boot" to stderr. and return error code 255 if the UEFI system doesn't support secure boot. Signed-off-by: Date Huang --- python/vyos/utils/system.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/vyos/utils/system.py b/python/vyos/utils/system.py index 7b12efb147..a556a8ec4e 100644 --- a/python/vyos/utils/system.py +++ b/python/vyos/utils/system.py @@ -145,5 +145,5 @@ def get_secure_boot_state() -> bool: from vyos.utils.boot import is_uefi_system if not is_uefi_system(): return False - tmp = cmd('mokutil --sb-state') + tmp = cmd('mokutil --sb-state', expect=[255]) return bool('enabled' in tmp)