update
modified: di_dialog.py
This commit is contained in:
@@ -119,7 +119,7 @@ class Raid(Dialog):
|
||||
# from os
|
||||
raid_text=''
|
||||
for R in ri_data.Raid.dict.values():
|
||||
raid_text+='%s:\n active %s\n spare %s\n'%(R.device,R.active_components,R.spare_components)
|
||||
raid_text+='%s (%s):\n active %s; spare %s\n'%(R.device,R.from_os,R.active_components,R.spare_components)
|
||||
|
||||
# fd
|
||||
fd_devices_test='fd: '+','.join(fd_devices)
|
||||
@@ -127,7 +127,6 @@ class Raid(Dialog):
|
||||
exit_info,raid=Dialog.dialog.menu(text='Plase select make raidX\n%s\n%s'%(raid_text,fd_devices_test),
|
||||
height=self.height,width=self.width,menu_height=3,choices=[('Raid0',''),('Raid1',''),('Raid5','')],
|
||||
title='Make a raid',ok_label='edit',help_button=1,help_label='Next',clear=1)
|
||||
#choices=list,title='Mount',ok_label='edit',help_button=1,help_label='Next',clear=1)
|
||||
|
||||
if exit_info == 0:
|
||||
dname=ri_data.Raid.get_next_device()
|
||||
@@ -140,32 +139,35 @@ class Raid(Dialog):
|
||||
pass
|
||||
|
||||
def set_data(self):
|
||||
list = [('make a raid?',''),('delect a raid?')]
|
||||
fd_devices=self.raid_raw_init()
|
||||
fd_devices_test=''
|
||||
raid_text=''
|
||||
while True:
|
||||
list = [('make a raid?',''),('delecte a raid?','')]
|
||||
fd_devices=self.raid_raw_init()
|
||||
fd_devices_test=''
|
||||
raid_text=''
|
||||
|
||||
if len(fd_devices) < 3 and not ri_data.Raid.dict.keys():
|
||||
return 0
|
||||
|
||||
if len(fd_devices) < 3:
|
||||
del list[0]
|
||||
else:
|
||||
fd_devices_test='fd: '+','.join(fd_devices)
|
||||
if len(fd_devices) < 3 and not ri_data.Raid.dict.keys():
|
||||
return 0
|
||||
else:
|
||||
fd_devices_test='fd: '+','.join(fd_devices)
|
||||
|
||||
from_os_list= [ R.from_os for R in ri_data.Raid.dict.values() ]
|
||||
|
||||
if not 'no' in from_os_list:
|
||||
del list[1]
|
||||
else:
|
||||
for R in ri_data.Raid.dict.values():
|
||||
raid_text+='%s (%s):\n active %s; spare %s\n'%(R.device,R.from_os,R.active_components,R.spare_components)
|
||||
|
||||
exit_info,string=Dialog.dialog.menu(text='Plase select make raidX\n%s\n%s'%(raid_text,fd_devices_test),
|
||||
height=self.height,width=self.width,menu_height=2,choices=list,title='Configure raid')
|
||||
|
||||
if not ri_data.Raid.dict.keys():
|
||||
del list[1]
|
||||
else:
|
||||
for R in ri_data.Raid.dict.values():
|
||||
raid_text+='%s:\n active %s\n spare %s\n'%(R.device,R.active_components,R.spare_components)
|
||||
|
||||
exit_info,string=Dialog.dialog.menu(text='Plase select make raidX\n%s\n%s'%(raid_text,fd_devices_test),
|
||||
height=self.height,width=self.width,menu_height=2,choices=list,title='Configure raid')
|
||||
|
||||
if exit_info == 0 and string == list[0][0]:
|
||||
self.make_raid()
|
||||
elif exit_info == 0 and string == list[1][0]:
|
||||
pass
|
||||
if exit_info == 0 and string == list[0][0]:
|
||||
self.make_raid()
|
||||
elif exit_info == 0 and string == list[1][0]:
|
||||
pass
|
||||
else:
|
||||
return
|
||||
|
||||
|
||||
class MountPoint(Dialog):
|
||||
@@ -392,7 +394,7 @@ class Prepar_installation(Dialog):
|
||||
return s
|
||||
|
||||
ri_data.init()
|
||||
R=Raid(15,40)
|
||||
R=Raid(20,50)
|
||||
R.set_data()
|
||||
#M=MountPoint(20,40)
|
||||
#M.set_data()
|
||||
|
||||
Reference in New Issue
Block a user