modified: ri_data.py
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user