Skip to content

Commit

Permalink
Closes netbox-community#1376: Ignore anycast when detecting duplicate…
Browse files Browse the repository at this point in the history
… IPs
  • Loading branch information
jeremystretch committed Aug 30, 2017
1 parent 200730c commit 9110e3d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions netbox/ipam/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
BulkCreateView, BulkDeleteView, BulkEditView, BulkImportView, ObjectDeleteView, ObjectEditView, ObjectListView,
)
from . import filters, forms, tables
from .constants import IPADDRESS_ROLE_ANYCAST
from .models import (
Aggregate, IPAddress, PREFIX_STATUS_ACTIVE, PREFIX_STATUS_DEPRECATED, PREFIX_STATUS_RESERVED, Prefix, RIR, Role,
Service, VLAN, VLANGroup, VRF,
Expand Down Expand Up @@ -624,6 +625,9 @@ def get(self, request, pk):
).select_related(
'interface__device', 'nat_inside'
)
# Exclude anycast IPs if this IP is anycast
if ipaddress.role == IPADDRESS_ROLE_ANYCAST:
duplicate_ips = duplicate_ips.exclude(role=IPADDRESS_ROLE_ANYCAST)
duplicate_ips_table = tables.IPAddressTable(list(duplicate_ips), orderable=False)

# Related IP table
Expand Down

0 comments on commit 9110e3d

Please sign in to comment.