Improves error detection

This commit is contained in:
Pierre Lannoy 2024-03-12 09:07:48 +01:00
commit 3d44530f39
Signed by: Pierre Lannoy
GPG key ID: D27231EF87D53F31
2 changed files with 2 additions and 1 deletions

View file

@ -66,6 +66,8 @@ class LLDP():
def get_switch_vlan(self, interface):
# lldp.eth0.vlan.vlan-id=296
if self.data['lldp'] is None:
return None
if self.data['lldp'].get(interface) is None:
return None
return self.data['lldp'][interface]['vlan']

View file

@ -25,7 +25,6 @@ class SupermicroHost(ServerBase):
# Blades
blade = product_name.startswith('SBI')
blade |= product_name.startswith('SBA')
blade |= product_name.startswith('AS ')
# Twin
blade |= 'TR-' in product_name
# TwinPro