Fix the function 'del_raid'
modified: new_partition/interface_partition.py
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user