From 7d75937a95c1fc13c11aaeea579a47a1377f5ca6 Mon Sep 17 00:00:00 2001 From: Aaron Klingaman Date: Mon, 23 Jan 2006 18:10:57 +0000 Subject: [PATCH] filter out partitions from block devices by using device minor number, not partition name format --- source/systeminfo.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source/systeminfo.py b/source/systeminfo.py index 8170ba2..4ade0f1 100755 --- a/source/systeminfo.py +++ b/source/systeminfo.py @@ -222,12 +222,6 @@ class systeminfo: device= parts[3] - # if the last char in device is a number, its - # a partition, and we ignore it - - if device[len(device)-1].isdigit(): - continue - dev_name= "/dev/%s" % device try: @@ -237,6 +231,10 @@ class systeminfo: except ValueError, err: continue + # skip and ignore any partitions + if minor != 0: + continue + gb_size= blocks/self.BLOCKS_PER_GB # parse the output of hdparm to get the readonly flag; -- 2.43.0