[megaclisas-status] bug fix : properly detect unconfigured drives when they were previously part of an array

This commit is contained in:
Vincent S. Cojot 2016-01-20 18:07:44 -05:00
parent 1bec3578f7
commit 517b2d35cd

View File

@ -151,9 +151,12 @@ def returnRebuildProgress(output):
def returnUnconfDriveNumber(output):
confdrives = 0
unconfdrives = 0
totaldrivenumber = 0
for line in output:
if re.match(r'.*Number of PDs:.*$',line.strip()):
confdrives += int(line.split(':')[2].strip())
totaldrivenumber += int(line.split(':')[2].strip())
if re.match(r'^Firmware state:.*$',line.strip()):
confdrives += 1
unconfdrives = totaldrivenumber - confdrives
return int(unconfdrives)