modified: ri_data.py
modified: ri_tk_cmd.py
when adding a raid,dynamic add the partitions into Mount.list or
when del a raid , dynamic del the partitions in Mount.list.
so the mothod of ri_tk_cmd.mp_top_init() is the correct.
This commit is contained in:
@@ -19,11 +19,8 @@ def serial_no_quit():
|
||||
def mount_list_init():
|
||||
''' initialize mount list '''
|
||||
l = []
|
||||
devs=ri_data.Raid.dev_in_raid()
|
||||
ri_data.MountPoint.init_from_internal()
|
||||
for m in ri_data.MountPoint.list:
|
||||
if m.device in devs:
|
||||
continue
|
||||
# get size from Partition info
|
||||
sz = ri_data.Partition.get_size(m.device)
|
||||
if not sz:
|
||||
@@ -41,6 +38,7 @@ def mp_top_init():
|
||||
''' mount dir top window initialize '''
|
||||
ml_win = ri_widget.Widget.dict['mount.list'].tk_widget
|
||||
idxs = ml_win.curselection()
|
||||
|
||||
if len(idxs) == 1:
|
||||
idx = int(idxs[0])
|
||||
mp = ri_data.MountPoint.list[idx]
|
||||
@@ -354,6 +352,9 @@ def raid_device_add():
|
||||
|
||||
dev = ri_data.Raid.get_next_device()
|
||||
ri_data.Raid(dev, "no", level, raid_calc_size(level, active), active, spare)
|
||||
for d in active+spare:
|
||||
ri_data.MountPoint.del_mount_dev(d)
|
||||
|
||||
raid_device_init()
|
||||
display.var_dict['raid_active_devs'].set(value='')
|
||||
display.var_dict['raid_spare_devs'].set(value='')
|
||||
@@ -386,6 +387,8 @@ def raid_device_delete():
|
||||
display.var_dict['raid_active_devs'].set(value=tuple(active))
|
||||
display.var_dict['raid_spare_devs'].set(value=tuple(spare))
|
||||
del ri_data.Raid.list[idx]
|
||||
for d in active+spare:
|
||||
ri_data.MountPoint.add_mount_dev(d)
|
||||
raid_device_init()
|
||||
|
||||
def raid_device_list_detail(*args):
|
||||
|
||||
Reference in New Issue
Block a user