Revision 8a4a931d snf-cyclades-app/synnefo/logic/ippool.py
b/snf-cyclades-app/synnefo/logic/ippool.py | ||
---|---|---|
36 | 36 |
|
37 | 37 |
""" |
38 | 38 |
if not self._contains(address): |
39 |
raise Exception("%s does not contain %s" % (self.network, address))
|
|
39 |
raise Exception("%s does not contain %s" % (str(self.network), address))
|
|
40 | 40 |
addr = ipaddr.IPAddress(address) |
41 | 41 |
|
42 | 42 |
return int(addr) - int(self.network.network) |
... | ... | |
69 | 69 |
|
70 | 70 |
def get_free_address(self): |
71 | 71 |
if self.is_full(): |
72 |
raise Exception("%s if full", self.network)
|
|
72 |
raise IPPool.IPPoolExhausted("%s if full" % str(self.network))
|
|
73 | 73 |
|
74 | 74 |
index = self.reservations.index(False) |
75 | 75 |
address = str(self.network[index]) |
Also available in: Unified diff