sos/sos-bz622784-parted-dumpe2fs-s390.patch
Bryn M. Reeves 13178ca5fa Update sos to 2.2-29
This synchronises sos in master to the current upstream sos-2.2 branch and
includes all patches from RHEL6 not already present.
2012-06-22 12:16:21 +01:00

32 lines
1.4 KiB
Diff

diff -up sos-2.2/sos/plugins/filesys.py.orig sos-2.2/sos/plugins/filesys.py
--- sos-2.2/sos/plugins/filesys.py.orig 2011-02-04 17:02:54.632926253 +0000
+++ sos-2.2/sos/plugins/filesys.py 2011-02-04 17:02:58.463947027 +0000
@@ -49,12 +49,22 @@ class filesys(sos.plugintools.PluginBase
partlist.append('/dev/' + line.split()[-1])
except IOError:
exit(1)
- for dev in partlist:
- ret, hdparm, time = self.callExtProg('/sbin/hdparm -g %s' %(dev))
- if(ret == 0):
- start_geo = hdparm.strip().split("\n")[-1].strip().split()[-1]
- if(start_geo == "0"):
+ if os.path.exists("/sbin/hdparm"):
+ for dev in partlist:
+ ret, hdparm, time = self.callExtProg('/sbin/hdparm -g %s' %(dev))
+ if(ret == 0):
+ start_geo = hdparm.strip().split("\n")[-1].strip().split()[-1]
+ if(start_geo == "0"):
+ devlist.append(dev)
+ # Cheaper heuristic as RHEL* does not ship hdparm for S390(x)
+ # Skips least dm-.* correctly
+ else:
+ part_in_disk = re.compile("^/dev/[a-z]+$")
+ for dev in partlist:
+ print part_in_disk.match(dev)
+ if bool(part_in_disk.match(dev)):
devlist.append(dev)
+
for i in devlist:
self.collectExtOutput("/sbin/parted -s %s print" % (i))