do not initialize RAID class when scanning for binary raid (to be reworked obviously) (#80)

This commit is contained in:
Solvik 2019-09-12 11:12:32 +02:00 committed by GitHub
parent 9f7f29c190
commit 93af39e780
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -216,18 +216,20 @@ class Inventory():
self.create_netbox_cpus()
def get_raid_cards(self):
raid_class = None
if self.server.manufacturer == 'Dell':
if is_tool('omreport'):
self.raid = OmreportRaid()
raid_class = OmreportRaid
if is_tool('storcli'):
self.raid = StorcliRaid()
raid_class = StorcliRaid
elif self.server.manufacturer == 'HP':
if is_tool('ssacli'):
self.raid = HPRaid()
raid_class = HPRaid
if not self.raid:
if not raid_class:
return []
self.raid = raid_class()
controllers = self.raid.get_controllers()
if len(self.raid.get_controllers()):
return controllers