Skip to content

Commit b424eb9

Browse files
authored
Fix PeerEndpoint validation to allow all interfaces including Virtual Chassis (#237)
Loosened PeerEndpoint validation
1 parent 6d507f8 commit b424eb9

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

changes/232.fixed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed PeerEndpoint validation to allow all interfaces (including Virtual Chassis)

nautobot_bgp_models/models.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,9 @@ def clean(self):
571571

572572
# Ensure IP related to the routing instance
573573
if self.routing_instance:
574-
if local_ip_value not in IPAddress.objects.filter(interfaces__device_id=self.routing_instance.device.id):
574+
if local_ip_value not in IPAddress.objects.filter(
575+
interfaces__in=self.routing_instance.device.vc_interfaces
576+
):
575577
raise ValidationError("Peer IP not associated with Routing Instance")
576578
# Enforce Routing Instance if local IP belongs to the Device
577579
elif not self.routing_instance and IPAddressToInterface.objects.filter(ip_address=local_ip_value).exists():

0 commit comments

Comments
 (0)