Correct the funciton to calculate raid size

Correct the funciton to del raid

       modified:   interface/ri_data.py
       modified:   new_partition/interface_partition.py
       modified:   text/ri_main.py
       modified:   text/ri_newt.py
This commit is contained in:
Peng Zhihui
2014-02-13 13:14:24 +08:00
parent 2002522ad5
commit 99c32ef85c
4 changed files with 21 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ while True :
if init_flag:
ri_data.init()
init_flag = False
if len(ri_newt.Raid.init_from_internal()) < 2:
if len(ri_newt.Raid.init_from_internal()) < 2 and len(ri_data.Raid.dict) == 0:
if list[2] == 'raid':
del list[2]
else:

View File

@@ -417,6 +417,14 @@ class Raid(Screen):
if s == 0:
device = Screen.listbox.current()
del ri_data.Raid.dict[device]
try:
os.system('umount /dev/%s >/dev/null 2>&1' %(device))
except:
pass
try:
os.system('mdadm --stop /dev/%s >/dev/null 2>&1' %(device))
except:
pass
return s
def set_data(self):