We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d94cb56 commit 109e1ddCopy full SHA for 109e1dd
ip_pool/ip_pool.py
@@ -58,7 +58,11 @@ def address_for(self, hostname: str) -> IPv4Address:
58
return addr
59
60
def release_address(self, hostname):
61
- addr = self._hostnames.pop(hostname)
+ try:
62
+ addr = self._hostnames.pop(hostname)
63
+ except KeyError:
64
+ raise IPAddressPoolException(f"No address for hostname {hostname}")
65
+
66
self._ipaddr_pool.append(addr)
67
self._ipaddr_pool.sort()
68
self._save()
0 commit comments