From 9d84ff4fe080e1be8032faee0f246e72f85426f6 Mon Sep 17 00:00:00 2001 From: Solvik Blum Date: Tue, 11 May 2021 21:17:58 +0200 Subject: [PATCH] add 25G compatibility --- netbox_agent/network.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/netbox_agent/network.py b/netbox_agent/network.py index 334ae01..986bc60 100644 --- a/netbox_agent/network.py +++ b/netbox_agent/network.py @@ -177,14 +177,19 @@ class Network(object): return self.dcim_choices['interface:type']['Other'] if nic['ethtool']['speed'] == '10000Mb/s': - if nic['ethtool']['port'] == 'FIBRE': + if nic['ethtool']['port'] in ('FIBRE', 'Direct Attach Copper'): return self.dcim_choices['interface:type']['SFP+ (10GE)'] return self.dcim_choices['interface:type']['10GBASE-T (10GE)'] + elif nic['ethtool']['speed'] == '25000Mb/s': + if nic['ethtool']['port'] in ('FIBRE', 'Direct Attach Copper'): + return self.dcim_choices['interface:type']['SFP28 (25GE)'] + elif nic['ethtool']['speed'] == '1000Mb/s': - if nic['ethtool']['port'] == 'FIBRE': + if nic['ethtool']['port'] in ('FIBRE', 'Direct Attach Copper'): return self.dcim_choices['interface:type']['SFP (1GE)'] return self.dcim_choices['interface:type']['1000BASE-T (1GE)'] + return self.dcim_choices['interface:type']['Other'] def get_or_create_vlan(self, vlan_id): -- 2.47.0