mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Merge branch 'develop' into develop-2.5 (v2.4.4 release)
This commit is contained in:
@ -1754,9 +1754,10 @@ class Interface(ComponentModel):
|
||||
blank=True,
|
||||
verbose_name='MAC Address'
|
||||
)
|
||||
mtu = models.PositiveSmallIntegerField(
|
||||
mtu = models.PositiveIntegerField(
|
||||
blank=True,
|
||||
null=True,
|
||||
validators=[MinValueValidator(1), MaxValueValidator(65536)],
|
||||
verbose_name='MTU'
|
||||
)
|
||||
mgmt_only = models.BooleanField(
|
||||
@ -2012,6 +2013,7 @@ class InterfaceConnection(models.Model):
|
||||
(self.interface_a, self.interface_b),
|
||||
(self.interface_b, self.interface_a),
|
||||
)
|
||||
|
||||
for interface, peer_interface in interfaces:
|
||||
if action == OBJECTCHANGE_ACTION_DELETE:
|
||||
connection_data = {
|
||||
@ -2022,11 +2024,17 @@ class InterfaceConnection(models.Model):
|
||||
'connected_interface': peer_interface.pk,
|
||||
'connection_status': self.connection_status
|
||||
}
|
||||
|
||||
try:
|
||||
parent_obj = interface.parent
|
||||
except ObjectDoesNotExist:
|
||||
parent_obj = None
|
||||
|
||||
ObjectChange(
|
||||
user=user,
|
||||
request_id=request_id,
|
||||
changed_object=interface,
|
||||
related_object=interface.parent,
|
||||
related_object=parent_obj,
|
||||
action=OBJECTCHANGE_ACTION_UPDATE,
|
||||
object_data=serialize_object(interface, extra=connection_data)
|
||||
).save()
|
||||
|
Reference in New Issue
Block a user