Skip to content

Commit c2166bb

Browse files
committed
Allow for specifying networks to look for free IP addresses in
1 parent c112b78 commit c2166bb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

adminapi/dataset.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,9 @@ def get_network_ip_addrs(self, attr='intern_ip'):
208208
if isinstance(addr, (IPv4Network, IPv6Network)):
209209
yield addr
210210

211-
def get_free_ip_addrs(self, attr='intern_ip'):
212-
networks = list(self.get_network_ip_addrs(attr))
211+
def get_free_ip_addrs(self, attr='intern_ip', networks=None):
212+
if networks is None:
213+
networks = list(self.get_network_ip_addrs(attr))
213214
if not networks:
214215
raise DatasetError('No networks')
215216

0 commit comments

Comments
 (0)