mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-27 10:58:37 -06:00
Don't handle ip without host names in reverse DNS
This commit is contained in:
parent
89a0049532
commit
5282eee5ce
@ -361,6 +361,7 @@ class Prefix(CreatedUpdatedModel):
|
|||||||
|
|
||||||
ipaddresses = IPAddress.objects.filter(family=4)
|
ipaddresses = IPAddress.objects.filter(family=4)
|
||||||
for ip in ipaddresses:
|
for ip in ipaddresses:
|
||||||
|
if ip.hostname:
|
||||||
ibytes = str(ip.address).split('/')[0].split('.')
|
ibytes = str(ip.address).split('/')[0].split('.')
|
||||||
islash = str(ip.address).split('/')[1]
|
islash = str(ip.address).split('/')[1]
|
||||||
i = netaddr.IPAddress(unicode('.'.join(ibytes)))
|
i = netaddr.IPAddress(unicode('.'.join(ibytes)))
|
||||||
@ -388,6 +389,7 @@ class Prefix(CreatedUpdatedModel):
|
|||||||
zslash = pslash if pslash % 16 == 0 else pslash/16+16
|
zslash = pslash if pslash % 16 == 0 else pslash/16+16
|
||||||
|
|
||||||
for ip in ipaddresses:
|
for ip in ipaddresses:
|
||||||
|
if ip.hostname:
|
||||||
ifull = str(ipaddress.IPv6Address(unicode(str(ip.address).split('/')[0])).exploded)
|
ifull = str(ipaddress.IPv6Address(unicode(str(ip.address).split('/')[0])).exploded)
|
||||||
inibbles = ifull.split(':')
|
inibbles = ifull.split(':')
|
||||||
idigits = ifull.replace(':','')[::-1]
|
idigits = ifull.replace(':','')[::-1]
|
||||||
|
Loading…
Reference in New Issue
Block a user