mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-31 12:56:24 -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
|
## 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.
|
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
|
### Device
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
## Fields
|
## 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.
|
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
|
### Virtual Machine
|
||||||
|
@ -12,6 +12,7 @@ __all__ = (
|
|||||||
'ConsolePortBulkCreateForm',
|
'ConsolePortBulkCreateForm',
|
||||||
'ConsoleServerPortBulkCreateForm',
|
'ConsoleServerPortBulkCreateForm',
|
||||||
'DeviceBayBulkCreateForm',
|
'DeviceBayBulkCreateForm',
|
||||||
|
# 'FrontPortBulkCreateForm',
|
||||||
'InterfaceBulkCreateForm',
|
'InterfaceBulkCreateForm',
|
||||||
'InventoryItemBulkCreateForm',
|
'InventoryItemBulkCreateForm',
|
||||||
'ModuleBayBulkCreateForm',
|
'ModuleBayBulkCreateForm',
|
||||||
|
@ -777,19 +777,7 @@ class MACAddressImportForm(NetBoxModelImportForm):
|
|||||||
if self.cleaned_data.get('interface'):
|
if self.cleaned_data.get('interface'):
|
||||||
self.instance.assigned_object = self.cleaned_data['interface']
|
self.instance.assigned_object = self.cleaned_data['interface']
|
||||||
|
|
||||||
mac_address = super().save(*args, **kwargs)
|
return 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
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user