You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the above extracts are done in reverse it fails:
>>> from netaddr import *
>>> splitter = SubnetSplitter('10.40.0.0/22')
>>> subnet_26s = splitter.extract_subnet(26, count=3)
>>> print splitter.available_subnets()
[IPNetwork('10.40.0.128/25'), IPNetwork('10.40.1.0/24'), IPNetwork('10.40.2.0/23')]
>>> subnet_24s = splitter.extract_subnet(24, count=3)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/lib/python2.7/site-packages/netaddr/contrib/subnet_splitter.py", line 28, in extract_subnet
subnets = list(cidr.subnet(prefix, count=count))
File "/lib/python2.7/site-packages/netaddr/ip/__init__.py", line 1271, in subnet
raise ValueError('count outside of current IP subnet boundary!')
ValueError: count outside of current IP subnet boundary!
It looks like it's not merging what's available in order to perform the 2nd extract but instead taking the 3 subnets and trying to split those individually, is this expected?
It appears
SubnetSplitter
isn't subnetting correctly, here's what I'm seeing:In this scenario I'm requesting 3 /24s and 3/26s from a /22
It's allocating
10.40.2.0/26
even with10.40.2.0/24
already allocated.The text was updated successfully, but these errors were encountered: