work on raid:
add 'from_os' attribute to raid and partition add raw init, raw_to_active
This commit is contained in:
@@ -226,3 +226,28 @@ def service_quit():
|
||||
if i.start != 'disable':
|
||||
vn = "service_%s" %(i.name)
|
||||
i.start = display.var_dict[vn].get()
|
||||
|
||||
def raid_raw_init():
|
||||
''' initialize raid raw devices (parttion with id 'fd' '''
|
||||
raw_devs = [ p.device for p in ri_data.Partition.list if p.id == 'fd' ]
|
||||
display.var_dict['raid_raw_devs'].set(value=tuple(raw_devs))
|
||||
|
||||
def raid_raw_to_active():
|
||||
''' move device from raw to active '''
|
||||
raw_win = ri_widget.Widget.dict['raid_raw.list'].tk_widget
|
||||
idxs = raw_win.curselection()
|
||||
if len(idxs) == 1:
|
||||
idx = int(idxs[0])
|
||||
raw_list = list(eval(display.var_dict['raid_raw_devs'].get()))
|
||||
raw_item = raw_list[idx]
|
||||
del raw_list[idx]
|
||||
print raw_list
|
||||
display.var_dict['raid_raw_devs'].set(value=tuple(raw_list))
|
||||
active_list = list(eval(display.var_dict['raid_active_devs'].get()))
|
||||
active_list.append(raw_item)
|
||||
display.var_dict['raid_active_devs'].set(value=tuple(active_list))
|
||||
|
||||
def raid_device_init():
|
||||
''' initialize raid device list '''
|
||||
raid_devs = [ r.device for r in ri_data.Raid.list if r.from_os == 'no' ]
|
||||
display.var_dict['raid_dev.list'].set(value=tuple(raid_devs))
|
||||
|
||||
Reference in New Issue
Block a user