Skip to contentSkip to conversation

rteval: Fix sysreport traceback when utility sos not found

PATCH New John Kacur 1 participant 1 message Jun 21, 2024

lore
Share & tools
lore

John Kacur

author
#0 lore raw

PATCH 1/1 rteval: Fix sysreport traceback when utility sos not found

When rteval is run with
-s, --sysreport run sysreport to collect system data (default: False)

and sos, sosreport or sysreport cannot be found then rteval exits with an error.

Fix this by adding /usr/bin to the places to search for this program.

---
 rteval/sysinfo/osinfo.py | 6 ++++++
 1 file changed, 6 insertions(+)
rteval/sysinfo/osinfo.py +6 -0
index 3d6d5f8daa96..3bdbcc81e068 100644
@@ -45,10 +45,16 @@ class OSInfo:
     def run_sysreport(self, repdir):
         if os.path.exists('/usr/sbin/sos'):
             exe = '/usr/sbin/sos report'
+        elif os.path.exists('/usr/bin/sos'):
+            exe = '/usr/bin/sos report'
         elif os.path.exists('/usr/sbin/sosreport'):
             exe = '/usr/sbin/sosreport'
+        elif os.path.exists('/usr/bin/sosreport'):
+            exe = '/usr/bin/sosreport'
         elif os.path.exists('/usr/sbin/sysreport'):
             exe = '/usr/sbin/sysreport'
+        elif os.path.exists('/usr/bin/sysreport'):
+            exe = '/usr/bin/sysreport'
         else:
             raise RuntimeError("Can't find sos/sosreport/sysreport")
 
Signature · 1 line
2.45.2