finish raid screen

This commit is contained in:
Li Zhi
2010-08-20 09:20:57 +07:59
parent ca9e003476
commit c2ec243021
6 changed files with 363 additions and 167 deletions

View File

@@ -258,6 +258,16 @@ p_node - xml node (parent node) '''
if r.device == dev:
return r.size
@staticmethod
def get_next_device():
''' get next available raid device name '''
num_p = re.compile(r'md(\d+)')
numbers = [ int(num_p.match(r.device).groups()[0]) for r in Raid.list ]
max = 0
for n in numbers:
if n > max: max = n
return 'md%d' %(max+1)
class MountPoint:
''' mount-points '''
list=[]