make sure lshw disks are backward compatible with raid disks, add get_vendor method and multiple fixes

This commit is contained in:
Solvik Blum 2019-09-04 12:11:46 +02:00
commit 8432abef79
No known key found for this signature in database
GPG key ID: CC12B3DC262B6C47
4 changed files with 84 additions and 57 deletions

View file

@ -1,6 +1,7 @@
import subprocess
import json
from netbox_agent.misc import get_vendor
from netbox_agent.raid.base import Raid, RaidController
@ -38,8 +39,10 @@ class StorcliController(RaidController):
)
drive_attr = drive_infos['{} - Detailed Information'.format(drive_identifier)][
'{} Device attributes'.format(drive_identifier)]
model = drive_attr.get('Model Number', '').strip()
ret.append({
'Model': drive_attr.get('Model Number', '').strip(),
'Model': model,
'Vendor': get_vendor(model),
'SN': drive_attr.get('SN', '').strip(),
'Size': size,
'Type': media_type,