aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorshnavid <shnavid@ef72aa8b-4018-0410-8976-d6e080ef94d8>2007-03-27 12:27:15 +0000
committershnavid <shnavid@ef72aa8b-4018-0410-8976-d6e080ef94d8>2007-03-27 12:27:15 +0000
commit59d860d122f069034c26d1a910786e54bdb81a96 (patch)
tree5ee752b97cafd707375714ad82674bdd6dd7728d /src
parent60b1d2dd5e57bfc51606c271eb37fc79ba829208 (diff)
downloadsos-59d860d122f069034c26d1a910786e54bdb81a96.tar.gz
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
Diffstat (limited to 'src')
-rw-r--r--src/lib/sos/plugins/hardware.py11
1 files 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")