mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-29 20:06:25 -06:00
Documentation notes and cleanup
This commit is contained in:
parent
e46d9a6d29
commit
e2e5af5303
@ -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
|
||||
|
@ -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
|
||||
|
@ -12,6 +12,7 @@ __all__ = (
|
||||
'ConsolePortBulkCreateForm',
|
||||
'ConsoleServerPortBulkCreateForm',
|
||||
'DeviceBayBulkCreateForm',
|
||||
# 'FrontPortBulkCreateForm',
|
||||
'InterfaceBulkCreateForm',
|
||||
'InventoryItemBulkCreateForm',
|
||||
'ModuleBayBulkCreateForm',
|
||||
|
@ -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)
|
||||
|
||||
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user