add 25G compatibility (#185)

This commit is contained in:
Solvik 2021-05-12 14:50:16 +01:00 committed by GitHub
parent 7147670255
commit c4eb8f34ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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):