Correct the funciton to calculate raid size
Correct the funciton to del raid
modified: interface/ri_data.py
modified: new_partition/interface_partition.py
modified: text/ri_main.py
modified: text/ri_newt.py
This commit is contained in:
@@ -330,11 +330,15 @@ p_node - xml node (parent node) '''
|
||||
def get_size(dev):
|
||||
''' calculate raid device size '''
|
||||
rd = Raid.dict[dev]
|
||||
sz = min([ float(interface_partition.get_num(p_d.Partition.dict[p_d.Partition.get_disk_from_partition('/dev/'+d)]\
|
||||
Min = min([ float(interface_partition.get_num(p_d.Partition.dict[p_d.Partition.get_disk_from_partition('/dev/'+d)]\
|
||||
['partition']['/dev/'+d]['size'])) for d in rd.active_components])
|
||||
if rd.level == '0': return str(interface_partition.pretty_unit(sz*len(rd.active_components)))
|
||||
elif rd.level == '1': return str(interface_partition.pretty_unit(sz*len(rd.active_components)/2))
|
||||
elif rd.level == '5': return str(interface_partition.pretty_unit(sz*(len(rd.active_components)-1)))
|
||||
Sum = sum([ float(interface_partition.get_num(p_d.Partition.dict[p_d.Partition.get_disk_from_partition('/dev/'+d)]\
|
||||
['partition']['/dev/'+d]['size'])) for d in rd.active_components])
|
||||
#if rd.level == '0': return str(interface_partition.pretty_unit(Min*len(rd.active_components)))
|
||||
#elif rd.level == '1': return str(interface_partition.pretty_unit(Min*len(rd.active_components)/2))
|
||||
if rd.level == '0': return str(interface_partition.pretty_unit(Sum))
|
||||
elif rd.level == '1': return str(interface_partition.pretty_unit(Min))
|
||||
elif rd.level == '5': return str(interface_partition.pretty_unit(Min*(len(rd.active_components)-1)))
|
||||
|
||||
@staticmethod
|
||||
def get_next_device():
|
||||
|
||||
Reference in New Issue
Block a user