modified: ri_data.py
modified get_next_dev.
This commit is contained in:
@@ -308,11 +308,11 @@ p_node - xml node (parent node) '''
|
||||
def get_next_device():
|
||||
''' get next available raid device name '''
|
||||
num_p = re.compile(r'md(\d+)')
|
||||
numbers = [ int(num_p.match(r).groups()[0]) for r in Raid.dict.keys() ]
|
||||
max = 0
|
||||
for n in numbers:
|
||||
if n > max: max = n
|
||||
return 'md%d' %(max+1)
|
||||
numbers = [ int(num_p.match(r).groups()[0]) for r in Raid.dict.keys()]
|
||||
numbers.sort()
|
||||
if numbers:
|
||||
return 'md%d' %(int(numbers[-1])+1)
|
||||
return 'md0'
|
||||
|
||||
@staticmethod
|
||||
def dev_in_raid():
|
||||
|
||||
Reference in New Issue
Block a user