diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2012-11-29 22:36:28 +0000 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2012-11-29 22:36:28 +0000 |
commit | e0e82d3c2ed81e267470c6719e1cb3cdc8ea3b1c (patch) | |
tree | dabe691efd368db6b9c9a76a7a5288131a0997a9 | |
parent | 77bde527d18fee1261e497e08527ec164d67bbb4 (diff) | |
download | sos-e0e82d3c2ed81e267470c6719e1cb3cdc8ea3b1c.tar.gz |
Fix hardware module to handle multiple lsusb paths
The usbutils package moved lsusb from /usr/sbin to /usr/bin. Allow
the module to work with either.
-rw-r--r-- | sos/plugins/hardware.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sos/plugins/hardware.py b/sos/plugins/hardware.py index b6418e98..d63fe15c 100644 --- a/sos/plugins/hardware.py +++ b/sos/plugins/hardware.py @@ -14,6 +14,7 @@ from sos.plugins import Plugin, RedHatPlugin, UbuntuPlugin, DebianPlugin from glob import glob +import os class hardware(Plugin): """hardware related information @@ -47,9 +48,14 @@ class hardware(Plugin): if self.policy().getArch().endswith("386"): self.collectExtOutput("/usr/sbin/x86info -a") - self.collectExtOutput("/usr/bin/lsusb") - self.collectExtOutput("/usr/bin/lsusb -v") - self.collectExtOutput("/usr/bin/lsusb -t") + if os.path.exists("/usr/bin/lsusb"): + lsusb_path = "/usr/bin/lsusb" + else: + lsusb_path = "/usr/bin/lsusb" + + self.collectExtOutput("%s"% lsusb_path) + self.collectExtOutput("%s -v"% lsusb_path) + self.collectExtOutput("%s -t"% lsusb_path) self.collectExtOutput("/usr/bin/lshal") self.collectExtOutput("/usr/bin/systool -c fc_host -v") |