mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Removed extraneous new_subnet() function on ipam.Prefix
This commit is contained in:
@ -487,16 +487,6 @@ class Prefix(CreatedUpdatedModel, CustomFieldModel):
|
|||||||
prefix_size -= 2
|
prefix_size -= 2
|
||||||
return int(float(child_count) / prefix_size * 100)
|
return int(float(child_count) / prefix_size * 100)
|
||||||
|
|
||||||
def new_subnet(self):
|
|
||||||
if self.family == 4:
|
|
||||||
if self.prefix.prefixlen <= 30:
|
|
||||||
return netaddr.IPNetwork('{}/{}'.format(self.prefix.network, self.prefix.prefixlen + 1))
|
|
||||||
return None
|
|
||||||
if self.family == 6:
|
|
||||||
if self.prefix.prefixlen <= 126:
|
|
||||||
return netaddr.IPNetwork('{}/{}'.format(self.prefix.network, self.prefix.prefixlen + 1))
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
class IPAddressManager(models.Manager):
|
class IPAddressManager(models.Manager):
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user