diff --git a/machines/models.py b/machines/models.py index cdc6d830..d02ee0f7 100644 --- a/machines/models.py +++ b/machines/models.py @@ -1044,6 +1044,16 @@ class Interface(RevMixin, AclMixin, FieldPermissionModelMixin, models.Model): IPv6Address(prefix_v6).exploded[:20] + IPv6Address(self.id).exploded[20:] ) + @cached_property + def get_vendor(self): + """Retourne le vendeur associé à la mac de l'interface""" + mac = EUI(self.mac_address) + try: + oui = mac.oui + vendor = oui.registration().org + except: + vendor = "Unknown vendor" + return(vendor) def sync_ipv6_dhcpv6(self): """Affecte une ipv6 dhcpv6 calculée à partir de l'id de la machine""" diff --git a/machines/templates/machines/aff_machines.html b/machines/templates/machines/aff_machines.html index 02ec3c91..6001f7ce 100644 --- a/machines/templates/machines/aff_machines.html +++ b/machines/templates/machines/aff_machines.html @@ -92,6 +92,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,