Documentation notes and cleanup

This commit is contained in:
Brian Tiemann 2024-11-14 14:02:13 -05:00
parent e46d9a6d29
commit e2e5af5303
4 changed files with 4 additions and 15 deletions

View File

@ -10,7 +10,7 @@ Interfaces in NetBox represent network interfaces used to exchange data with con
## Fields
!!! note
!!! note "Changed in NetBox v4.2"
The MAC address of an interface (formerly a concrete database field) is available as a property, `mac_address`, which reflects the value of the primary linked [MAC address](./macaddress.md) object.
### Device

View File

@ -4,7 +4,7 @@
## Fields
!!! note
!!! note "Changed in NetBox v4.2"
The MAC address of an interface (formerly a concrete database field) is available as a property, `mac_address`, which reflects the value of the primary linked [MAC address](./macaddress.md) object.
### Virtual Machine

View File

@ -12,6 +12,7 @@ __all__ = (
'ConsolePortBulkCreateForm',
'ConsoleServerPortBulkCreateForm',
'DeviceBayBulkCreateForm',
# 'FrontPortBulkCreateForm',
'InterfaceBulkCreateForm',
'InventoryItemBulkCreateForm',
'ModuleBayBulkCreateForm',

View File

@ -777,19 +777,7 @@ class MACAddressImportForm(NetBoxModelImportForm):
if self.cleaned_data.get('interface'):
self.instance.assigned_object = self.cleaned_data['interface']
mac_address = super().save(*args, **kwargs)
# Set as primary for device/VM
# TODO: set as primary for interface
# if self.cleaned_data.get('is_primary'):
# parent = self.cleaned_data.get('device') or self.cleaned_data.get('virtual_machine')
# if self.instance.address.version == 4:
# parent.primary_ip4 = ipaddress
# elif self.instance.address.version == 6:
# parent.primary_ip6 = ipaddress
# parent.save()
return mac_address
return super().save(*args, **kwargs)
#