From eeeec9a325c047824b41318e20ec3ce4f490d6f3 Mon Sep 17 00:00:00 2001 From: David Murphy Date: Thu, 10 Oct 2024 14:49:54 -0600 Subject: [PATCH] Allow for secure-boot efivars directory having SecureBoot-xxx files, not directories with a data file --- salt/grains/extra.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/salt/grains/extra.py b/salt/grains/extra.py index 300052f1eed..4180ff3b51e 100644 --- a/salt/grains/extra.py +++ b/salt/grains/extra.py @@ -66,7 +66,10 @@ def config(): def __secure_boot(efivars_dir): """Detect if secure-boot is enabled.""" enabled = False - sboot = glob.glob(os.path.join(efivars_dir, "SecureBoot-*/data")) + if "efivars" == os.path.basename(efivars_dir): + sboot = glob.glob(os.path.join(efivars_dir, "SecureBoot-*")) + else: + sboot = glob.glob(os.path.join(efivars_dir, "SecureBoot-*/data")) if len(sboot) == 1: # The minion is usually running as a privileged user, but is # not the case for the master. Seems that the master can also