def get_dhcp_leases(context, network_ref):
 hosts = []
 host = None
 if network_ref['multi_host']:
  host = CONF.host
 for data in db.network_get_associated_fixed_ips(context, network_ref['id'], host=host):
  if (data['allocated'] and data['leased']):
   hosts.append(_host_lease(data))
 return '\n'.join(hosts)

def get_dhcp_leases ( context , network_ref ) : hosts = [ ] host = None if network_ref [ 'multi_host' ] : host = CONF . host for data in db . network_get_associated_fixed_ips ( context , network_ref [ 'id' ] , host = host ) : if ( data [ 'allocated' ] and data [ 'leased' ] ) : hosts . append ( _host_lease ( data ) ) return '\n' . join ( hosts )
return a networks hosts config in dnsmasq leasefile format .