def get_ip_address(name, ip_q):
 try:
  ip_addr = ip_q.get(timeout=1)
  while (ip_addr in USED_IPS):
   ip_addr = ip_q.get(timeout=1)
  else:
   USED_IPS.add(ip_addr)
   return str(ip_addr)
 except AttributeError:
  return None
 except Queue.Empty:
  raise SystemExit(('Cannot retrieve requested amount of IP addresses. Increase the %s range in your openstack_user_config.yml.' % name))

def get_ip_address ( name , ip_q ) : try : ip_addr = ip_q . get ( timeout = 1 ) while ( ip_addr in USED_IPS ) : ip_addr = ip_q . get ( timeout = 1 ) else : USED_IPS . add ( ip_addr ) return str ( ip_addr ) except AttributeError : return None except Queue . Empty : raise SystemExit ( ( 'Cannot retrieve requested amount of IP addresses. Increase the %s range in your openstack_user_config.yml.' % name ) )
retrieves the local ip address of a network interface .