Closes #1246: Added ability to auto-create the next available IP address within a prefix

This commit is contained in:
Jeremy Stretch
2017-06-30 16:51:31 -04:00
parent a23da9f867
commit 30d1605007
3 changed files with 76 additions and 16 deletions

View File

@@ -331,7 +331,7 @@ class Prefix(CreatedUpdatedModel, CustomFieldModel):
Return all available IPs within this prefix as an IPSet.
"""
prefix = netaddr.IPSet(self.prefix)
child_ips = netaddr.IPSet([ip.address for ip in self.get_child_ips()])
child_ips = netaddr.IPSet([ip.address.ip for ip in self.get_child_ips()])
available_ips = prefix - child_ips
# Remove unusable IPs from non-pool prefixes