mirror of
https://github.com/eLvErDe/hwraid.git
synced 2025-07-23 22:04:23 +02:00
[megaclisas-status] bug fix : properly detect unconfigured drives when they were previously part of an array
This commit is contained in:
parent
1bec3578f7
commit
517b2d35cd
@ -151,9 +151,12 @@ def returnRebuildProgress(output):
|
|||||||
def returnUnconfDriveNumber(output):
|
def returnUnconfDriveNumber(output):
|
||||||
confdrives = 0
|
confdrives = 0
|
||||||
unconfdrives = 0
|
unconfdrives = 0
|
||||||
|
totaldrivenumber = 0
|
||||||
for line in output:
|
for line in output:
|
||||||
if re.match(r'.*Number of PDs:.*$',line.strip()):
|
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
|
unconfdrives = totaldrivenumber - confdrives
|
||||||
return int(unconfdrives)
|
return int(unconfdrives)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user