modified: ri_data.py

This commit is contained in:
fling
2010-10-15 18:35:58 +08:00
parent 64b99ddbd9
commit 4a4f21fcde

View File

@@ -81,8 +81,8 @@ class Partition:
l = [ s.split()[-1] for s in o.splitlines() if re.match(r'\s*\d+', s)]
# devices : 1) sda, sdb(first if ), or md0 (second if)
for d in [ i for i in l if not re.search(r'\d+', i)
or re.search(r'([a-zA-Z]+)', i).group(1) not in l]
for d in [ i for i in l if not re.search(r'\d+', i)\
or re.search(r'([a-zA-Z]+)', i).group(1) not in l]:
st,o=commands.getstatusoutput('parted /dev/%s unit %s print'%(d,Partition.unit))
if st:
print "Error parted execute error"
@@ -306,7 +306,7 @@ p_node - xml node (parent node) '''
def dev_in_raid():
"""if the device in raid or not"""
devices_in_raid=set()
for r in Raid.list:
for r in Raid.dict.values():
devices_in_raid.update(r.active_components)
devices_in_raid.update(r.spare_components)
return devices_in_raid
@@ -339,7 +339,7 @@ class MountPoint:
MountPoint(dev, fs=Partition.dict[dev].filesystem)
for dev in Raid.dict.keys():
if MountPoint.dict.has_key(dev)
if MountPoint.dict.has_key(dev):
continue
MountPoint(dev)