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