3ware-status: fail with IndexError if disk has no model type (uh?)

This commit is contained in:
Adam Cécile 2017-09-12 17:38:01 +02:00 committed by GitHub
parent 1cc125452a
commit 5514c5067a
1 changed files with 5 additions and 1 deletions

View File

@ -92,7 +92,11 @@ if not nagiosmode:
print '-- ID | Model'
for controller in controllerlist:
cmd = binarypath+' info '+controller+' model'
model = getOutput(cmd)[0].split(' = ')[1].strip()
# https://github.com/eLvErDe/hwraid/issues/69
try:
model = getOutput(cmd)[0].split(' = ')[1].strip()
except IndexError:
model = 'N/A'
print controller+' | '+model
print ''