Several minor fixes
raid_arry check should return an empty array, not NoneType not all systems will have IPv6 defined, so try to get the information.. if not just continue on. Vendor Supermicro was incomplete.
This commit is contained in:
parent
5b7e349aa3
commit
1c3ea69d9e
3 changed files with 13 additions and 3 deletions
|
@ -102,7 +102,7 @@ class Inventory():
|
|||
self.raid = HPRaid()
|
||||
|
||||
if not self.raid:
|
||||
return
|
||||
return []
|
||||
|
||||
controllers = self.raid.get_controllers()
|
||||
if len(self.raid.get_controllers()):
|
||||
|
|
|
@ -60,7 +60,11 @@ class Network():
|
|||
continue
|
||||
|
||||
ip_addr = netifaces.ifaddresses(interface).get(netifaces.AF_INET)
|
||||
ip_addr += netifaces.ifaddresses(interface).get(netifaces.AF_INET6)
|
||||
try:
|
||||
ip_addr += netifaces.ifaddresses(interface).get(netifaces.AF_INET6)
|
||||
except:
|
||||
logging.debug('No IPv6 addresses defined.')
|
||||
|
||||
if NETWORK_IGNORE_IPS and ip_addr:
|
||||
for i, ip in enumerate(ip_addr):
|
||||
if re.match(NETWORK_IGNORE_IPS, ip['addr']):
|
||||
|
|
8
netbox_agent/vendors/supermicro.py
vendored
8
netbox_agent/vendors/supermicro.py
vendored
|
@ -2,8 +2,14 @@ from netbox_agent.server import ServerBase
|
|||
|
||||
|
||||
class SupermicroHost(ServerBase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(SupermicroHost, self).__init__(*args, **kwargs)
|
||||
self.manufacturer = 'Supermicro'
|
||||
|
||||
def is_blade(self):
|
||||
return self.get_product_name().startswith('SBI')
|
||||
blade = self.get_product_name().startswith('SBI')
|
||||
blade |= self.get_product_name().startswith('SYS')
|
||||
return blade
|
||||
|
||||
def get_blade_slot(self):
|
||||
# No supermicro on hands
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue