Very minor bugfixes (Rev 1.2)

This commit is contained in:
Vincent S. Cojot 2011-07-26 16:52:51 -04:00
parent 482023d8b1
commit 0c7a0ed4fe
1 changed files with 3 additions and 4 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/python #!/usr/bin/python
# $Id: megaclisas-status,v 1.1 2011/01/14 09:10:44 root Exp $ # $Id: megaclisas-status,v 1.2 2011/07/26 16:52:51 root Exp $
import os import os
import re import re
@ -84,7 +84,7 @@ def returnDiskInfo(output,controllerid):
state = 'Offline' state = 'Offline'
model = 'Unknown' model = 'Unknown'
for line in output: for line in output:
if re.match(r'^Virtual Disk: [0-9]+.*$',line.strip()): if re.match(r'^Virtual Drive: [0-9]+.*$',line.strip()):
arrayid = line.split('(')[0].split(':')[1].strip() arrayid = line.split('(')[0].split(':')[1].strip()
if re.match(r'Firmware state: .*$',line.strip()): if re.match(r'Firmware state: .*$',line.strip()):
state = line.split(':')[1].strip() state = line.split(':')[1].strip()
@ -150,8 +150,7 @@ while controllerid < controllernumber:
output = getOutput(cmd) output = getOutput(cmd)
arraynumber = returnArrayNumber(output) arraynumber = returnArrayNumber(output)
#### BUG: -LdPdInfo shows all PD on the adapter, not just for said LD.. #### BUG: -LdPdInfo shows all PD on the adapter, not just for said LD..
#### while arrayid < arraynumber: while arrayid <= arraynumber:
while arrayid < 1:
cmd = 'megacli -LdPdInfo -a'+str(controllerid)+' -NoLog' cmd = 'megacli -LdPdInfo -a'+str(controllerid)+' -NoLog'
output = getOutput(cmd) output = getOutput(cmd)
arraydisk = returnDiskInfo(output,controllerid) arraydisk = returnDiskInfo(output,controllerid)