diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2011-09-23 09:00:00 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2011-09-23 09:00:00 +0100 |
commit | 46b8aabf5775bfda4229bfffec72490c642bbc5b (patch) | |
tree | 61017b53c7069a500e0b4d8ae023de1e456672ec | |
parent | c0306151c9b907f29651a800f2a7e25371fc9bec (diff) | |
download | sos-2.2-16.el6.tar.gz |
Fix hardware plugin to support new lsusb pathsos-2.2-16.el6
Resolves: bz691477
-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 66cdcd5a..7f134dd2 100644 --- a/sos/plugins/hardware.py +++ b/sos/plugins/hardware.py @@ -13,6 +13,7 @@ ## Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. import sos.plugintools +import os class hardware(sos.plugintools.PluginBase): """hardware related information @@ -44,9 +45,14 @@ class hardware(sos.plugintools.PluginBase): if self.policy().getArch().endswith("386"): self.collectExtOutput("/usr/sbin/x86info -a") - self.collectExtOutput("/usr/sbin/lsusb") - self.collectExtOutput("/usr/sbin/lsusb -v") - self.collectExtOutput("/usr/sbin/lsusb -t 2>&1", suggest_filename = "lsusb_-t") + if os.path.exists("/usr/bin/lsusb"): + self.collectExtOutput("/usr/bin/lsusb") + self.collectExtOutput("/usr/bin/lsusb -v") + self.collectExtOutput("/usr/bin/lsusb -t 2>&1", suggest_filename = "lsusb_-t") + elif os.path.exists("/sbin/lsusb"): + self.collectExtOutput("/sbin/lsusb") + self.collectExtOutput("/sbin/lsusb -v") + self.collectExtOutput("/sbin/lsusb -t 2>&1", suggest_filename = "lsusb_-t") self.collectExtOutput("/usr/bin/lshal") self.collectExtOutput("/usr/bin/systool -c fc_host -v") self.collectExtOutput("/usr/bin/systool -c scsi_host -v") |