From fffef9b621d9afff1d6fcdae17c8a0fab76aadc5 Mon Sep 17 00:00:00 2001 From: Jason Ertel Date: Thu, 7 Mar 2024 12:31:51 -0500 Subject: [PATCH] gracefully handle status check failure on ubuntu --- salt/common/tools/sbin/so-common-status-check | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/salt/common/tools/sbin/so-common-status-check b/salt/common/tools/sbin/so-common-status-check index d713ba6c6..625e0f199 100644 --- a/salt/common/tools/sbin/so-common-status-check +++ b/salt/common/tools/sbin/so-common-status-check @@ -47,10 +47,14 @@ def check_for_fps(): fps = 1 except FileNotFoundError: fn = '/proc/sys/crypto/' + feat_full + '_enabled' - with open(fn, 'r') as f: - contents = f.read() - if '1' in contents: - fps = 1 + try: + with open(fn, 'r') as f: + contents = f.read() + if '1' in contents: + fps = 1 + except: + # Unknown, so assume 0 + fps = 0 with open('/opt/so/log/sostatus/lks_enabled', 'w') as f: f.write(str(fps))