public inbox for linux-rt-users@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] rteval: Only process warnings if dmidecode_loaded is True
@ 2021-09-09 13:03 John Kacur
  2021-09-09 13:03 ` [PATCH 2/3] rteval: Construct a 'model name' on architectures that don't have one John Kacur
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: John Kacur @ 2021-09-09 13:03 UTC (permalink / raw)
  To: RT, Clark Williams; +Cc: John Kacur

If python-dmidecode is not available, then you can't test hasattr
or you will get a NameError. Simply return instead.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 rteval/sysinfo/dmi.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/rteval/sysinfo/dmi.py b/rteval/sysinfo/dmi.py
index bd397360096a..80cf3c723b36 100644
--- a/rteval/sysinfo/dmi.py
+++ b/rteval/sysinfo/dmi.py
@@ -42,6 +42,9 @@ except ModuleNotFoundError:
 def ProcessWarnings():
     """ Process Warnings from dmidecode """
 
+    if not dmidecode_loaded:
+        return
+
     if not hasattr(dmidecode, 'get_warnings'):
         return
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-09-13  6:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-09 13:03 [PATCH 1/3] rteval: Only process warnings if dmidecode_loaded is True John Kacur
2021-09-09 13:03 ` [PATCH 2/3] rteval: Construct a 'model name' on architectures that don't have one John Kacur
2021-09-09 13:03 ` [PATCH 3/3] rteval: systopology.py: Add support for systems that don't have Numa John Kacur
2021-09-13  6:02   ` Punit Agrawal
2021-09-13  5:39 ` [PATCH 1/3] rteval: Only process warnings if dmidecode_loaded is True Punit Agrawal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox