Skip to content
Snippets Groups Projects
Commit fe48d53c authored by Dimitris Aragriorgs's avatar Dimitris Aragriorgs
Browse files

Do not allow networks with less than 8 hosts


This is only needed in case base64 and bitarray.tostring() is used for
saving reservations. If bitarray.to01() was used then we would not have
this restriction.

Signed-off-by: default avatarDimitris Aragriorgs <dimara@grnet.gr>
parent d177a22a
No related branches found
No related tags found
No related merge requests found
......@@ -75,6 +75,7 @@ class AddressPool(object):
self.ext_reservations = bitarray(self.network.numhosts)
self.ext_reservations.setall(False)
assert self.network.numhosts >= 8
assert len(self.reservations) == self.network.numhosts
assert len(self.ext_reservations) == self.network.numhosts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment