Fix the function 'del_raid'

modified:   new_partition/interface_partition.py
This commit is contained in:
Peng Zhihui
2014-01-16 16:47:31 +08:00
parent 2ab2cc7639
commit c86cee75af

View File

@@ -234,6 +234,8 @@ def show_error(tips):
def del_raid(dev):
md = ''
try:
if p_d.Partition.dict[dev]['partition_table'] == '':
return
for partition in p_d.sort_partitions(p_d.Partition.dict, dev, 'partition'):
for raid in ri_data.Raid.dict.keys():
for p in ri_data.Raid.dict[raid].active_components + ri_data.Raid.dict[raid].spare_components:
@@ -1320,10 +1322,10 @@ def main():
g.add(bb1, 0, 3)
res1 = g.runOnce()
if bb1.buttonPressed(res1) == "ok":
del_raid(dev)
label = rb.getSelection()
p_d.Partition.dict[dev]['partition_table'] = label
del_raid(dev)
#os.system('parted -s %s mklabel %s' %(dev,label))
p_d.delete_all_partitions(p_d.Partition.dict, dev)