From 59d860d122f069034c26d1a910786e54bdb81a96 Mon Sep 17 00:00:00 2001 From: shnavid Date: Tue, 27 Mar 2007 12:27:15 +0000 Subject: Fixed hardware plugin to use modules.pcimap instead of deprecated pcitable. However, this collection doesn't make much sense to me so we need to clarify what its purpose is. git-svn-id: svn+ssh://svn.fedorahosted.org/svn/sos/trunk@102 ef72aa8b-4018-0410-8976-d6e080ef94d8 --- src/lib/sos/plugins/hardware.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lib/sos/plugins/hardware.py b/src/lib/sos/plugins/hardware.py index 3571be2a..12106c3b 100644 --- a/src/lib/sos/plugins/hardware.py +++ b/src/lib/sos/plugins/hardware.py @@ -37,11 +37,14 @@ class hardware(sos.plugintools.PluginBase): self.addCopySpec("/proc/s390dbf/tape") self.collectExtOutput("/usr/share/rhn/up2dateclient/hardware.py") self.collectExtOutput("/sbin/lspci -vvn") - self.collectExtOutput("dmesg | grep -e 'e820.' -e 'agp.'") + self.collectExtOutput("/bin/dmesg | /bin/grep -e 'e820.' -e 'agp.'") - for hwmodule in commands.getoutput('cat pcitable | grep -v "Card:" | awk \'{ gsub("\"","",$0); { print $NF; };} \' | uniq -u'): - cmdToRun = "dmesg | grep %s" % (hwmodule,) - self.collectExtOutput(cmdToRun) + tmpreg = "" + for hwmodule in commands.getoutput('cat /lib/modules/$(uname -r)/modules.pcimap | cut -d " " -f 1 | grep "[:alpha:]" | sort -u').split("\n"): + hwmodule = hwmodule.strip() + if len(hwmodule): + tmpreg = tmpreg + "|" + hwmodule + self.collectExtOutput("/bin/dmesg | /bin/egrep '(%s)'" % tmpreg[1:]) self.collectExtOutput("/sbin/lsusb") self.collectExtOutput("/usr/bin/lshal") -- cgit