From 839d9a908c4e7ae5f3055dd5fc4355985fd0484f Mon Sep 17 00:00:00 2001 From: Solvik Blum Date: Sat, 11 Jul 2020 15:56:10 +0200 Subject: [PATCH] better handling supermicro products (blade or not blade) --- netbox_agent/vendors/supermicro.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/netbox_agent/vendors/supermicro.py b/netbox_agent/vendors/supermicro.py index b10b7fd..c027409 100644 --- a/netbox_agent/vendors/supermicro.py +++ b/netbox_agent/vendors/supermicro.py @@ -23,8 +23,17 @@ class SupermicroHost(ServerBase): self.manufacturer = 'Supermicro' def is_blade(self): - blade = self.system[0]['Product Name'].startswith('SBI') - blade |= self.system[0]['Product Name'].startswith('SYS') + product_name = self.get_product_name() + # Blades + blade = product_name.startswith('SBI') + blade |= product_name.startswith('SBA') + # Twin + blade |= 'TR-' in product_name + # BigTwin + blade |= 'BT-' in product_name + # Microcloud + blade |= product_name.startswith('SYS-5039') + blade |= product_name.startswith('SYS-5038') return blade def get_blade_slot(self):