mirror of
https://github.com/eLvErDe/hwraid.git
synced 2025-07-25 23:04:44 +02:00
Very minor bugfixes (Rev 1.48)
This commit is contained in:
parent
bf3ba8dd2c
commit
496297e3f0
@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# $Id: megaclisas-status,v 1.47 2015/04/17 02:58:20 root Exp $
|
# $Id: megaclisas-status,v 1.48 2015/04/17 14:08:43 root Exp $
|
||||||
#
|
#
|
||||||
# Written by Adam Cecile <gandalf@NOSPAM.le-vert.net>
|
# Written by Adam Cecile <gandalf@NOSPAM.le-vert.net>
|
||||||
# Modified vy Vincent S. Cojot <vincent@NOSPAM.cojot.name>
|
# Modified vy Vincent S. Cojot <vincent@NOSPAM.cojot.name>
|
||||||
@ -178,7 +178,7 @@ def returnArrayNumber(output):
|
|||||||
i += 1
|
i += 1
|
||||||
return i
|
return i
|
||||||
|
|
||||||
def returnPCIInfo(output):
|
def returnHBAPCIInfo(output):
|
||||||
busprefix = '0000'
|
busprefix = '0000'
|
||||||
busid = ''
|
busid = ''
|
||||||
devid = ''
|
devid = ''
|
||||||
@ -191,9 +191,12 @@ def returnPCIInfo(output):
|
|||||||
devid = str(line.strip().split(':')[1].strip()).zfill(2)
|
devid = str(line.strip().split(':')[1].strip()).zfill(2)
|
||||||
if re.match(r'^Function Number.*:.*$',line.strip()):
|
if re.match(r'^Function Number.*:.*$',line.strip()):
|
||||||
functionid = str(line.strip().split(':')[1].strip()).zfill(1)
|
functionid = str(line.strip().split(':')[1].strip()).zfill(1)
|
||||||
pcipath = str(busprefix + ':' + busid + ':' + devid + '.' + functionid)
|
if busid:
|
||||||
dbgprint("Array PCI path : "+pcipath)
|
pcipath = str(busprefix + ':' + busid + ':' + devid + '.' + functionid)
|
||||||
return str(pcipath)
|
dbgprint("Array PCI path : "+pcipath)
|
||||||
|
return str(pcipath)
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
def returnHBAInfo(table,output,controllerid):
|
def returnHBAInfo(table,output,controllerid):
|
||||||
controllermodel = 'Unknown'
|
controllermodel = 'Unknown'
|
||||||
@ -507,7 +510,7 @@ if printarray:
|
|||||||
|
|
||||||
cmd = '%s -AdpGetPciInfo -a%d -NoLog' % (megaclipath, controllerid)
|
cmd = '%s -AdpGetPciInfo -a%d -NoLog' % (megaclipath, controllerid)
|
||||||
output = getOutput(cmd)
|
output = getOutput(cmd)
|
||||||
pcipath = returnPCIInfo(output)
|
pcipath = returnHBAPCIInfo(output)
|
||||||
|
|
||||||
cmd = '%s -LDInfo -lall -a%d -NoLog' % (megaclipath, controllerid)
|
cmd = '%s -LDInfo -lall -a%d -NoLog' % (megaclipath, controllerid)
|
||||||
output = getOutput(cmd)
|
output = getOutput(cmd)
|
||||||
@ -518,11 +521,14 @@ if printarray:
|
|||||||
output = getOutput(cmd)
|
output = getOutput(cmd)
|
||||||
arrayinfo = returnArrayInfo(output,controllerid, ldid)
|
arrayinfo = returnArrayInfo(output,controllerid, ldid)
|
||||||
|
|
||||||
diskprefix = str('/dev/disk/by-path/pci-' + pcipath + '-scsi-0:')
|
if pcipath:
|
||||||
for j in range (8):
|
diskprefix = str('/dev/disk/by-path/pci-' + pcipath + '-scsi-0:')
|
||||||
diskpath = diskprefix + str(j) + ':' + str(arrayinfo[7]) + ':0'
|
for j in range (8):
|
||||||
if os.path.exists(diskpath):
|
diskpath = diskprefix + str(j) + ':' + str(arrayinfo[7]) + ':0'
|
||||||
arrayinfo[7] = os.path.realpath(diskpath)
|
if os.path.exists(diskpath):
|
||||||
|
arrayinfo[7] = os.path.realpath(diskpath)
|
||||||
|
else:
|
||||||
|
arrayinfo[7] = 'N/A'
|
||||||
|
|
||||||
ldfmt = str('%-5s | %-'+str(rlen)+'s | %7s | %7s | %'+str(mlen)+'s | %8s | %7s | %8s | %-12s ')
|
ldfmt = str('%-5s | %-'+str(rlen)+'s | %7s | %7s | %'+str(mlen)+'s | %8s | %7s | %8s | %-12s ')
|
||||||
# Header
|
# Header
|
||||||
|
Loading…
x
Reference in New Issue
Block a user