def load_ip_q(cidr, ip_q):
 _all_ips = [str(i) for i in list(netaddr.IPNetwork(cidr))]
 base_exclude = [str(netaddr.IPNetwork(cidr).network), str(netaddr.IPNetwork(cidr).broadcast)]
 USED_IPS.update(base_exclude)
 for ip in random.sample(_all_ips, len(_all_ips)):
  if (ip not in USED_IPS):
   ip_q.put(ip)

def load_ip_q ( cidr , ip_q ) : _all_ips = [ str ( i ) for i in list ( netaddr . IPNetwork ( cidr ) ) ] base_exclude = [ str ( netaddr . IPNetwork ( cidr ) . network ) , str ( netaddr . IPNetwork ( cidr ) . broadcast ) ] USED_IPS . update ( base_exclude ) for ip in random . sample ( _all_ips , len ( _all_ips ) ) : if ( ip not in USED_IPS ) : ip_q . put ( ip )
load the ip queue with all ip address from a given cidr .