mirror of
https://github.com/eLvErDe/hwraid.git
synced 2025-07-27 07:44:01 +02:00
[megaclisas-status] Do not use un-initialized arrays
This commit is contained in:
parent
34abdc9132
commit
2561f0cb8d
@ -28,7 +28,8 @@ totaldrivenumber = 0
|
||||
|
||||
# Hardcode a max of 16 HBA for now. LDTable must be initialized to accept populating list of LD's into each ctlr's list.
|
||||
LDTable = [ [] * 16 for i in range(16) ]
|
||||
NestedLDTable = [ [] * 16 for i in range(16) ]
|
||||
NestedLDTable = [[False for i in range(16)] for j in range(16)]
|
||||
|
||||
# Outputs is a 'dict' of all MegaCLI outputs so we can re-use them during loops..
|
||||
Outputs = {}
|
||||
|
||||
@ -344,6 +345,7 @@ def returnArrayInfo(output,controllerid,arrayid,arrayindex):
|
||||
inprogress = 'None'
|
||||
|
||||
# Compute the RAID level
|
||||
NestedLDTable[int(controllerid)][int(arrayindex)] = False
|
||||
if (int(spandepth) >= 2):
|
||||
raidtype = str('RAID-' + str(raidlvl) + '0')
|
||||
NestedLDTable[controllerid][int(arrayindex)] = True
|
||||
@ -595,7 +597,7 @@ if printarray:
|
||||
ldid += 1
|
||||
elif re.match(r'^(CacheCade )?Virtual Drive:',line.strip()):
|
||||
LDTable[controllerid].append ( ldid )
|
||||
NestedLDTable[controllerid][int(arrayindex)] = False
|
||||
#NestedLDTable[controllerid][int(arrayindex)] = False
|
||||
ldcount += 1
|
||||
ldid += 1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user