def get_dhcp_leases(context, network_ref):
    hosts = []
    host = None
    if network_ref['multi_host']:
        host = CONF.host
    for fixedip in objects.FixedIPList.get_by_network(context,
                                                      network_ref,
                                                      host=host):
        # NOTE(cfb): Don't return a lease entry if the IP isn't
        #            already leased
        if fixedip.leased:
            hosts.append(_host_lease(fixedip))

    return '\n'.join(hosts)
Return a network's hosts config in dnsmasq leasefile format.
dataset/ETHPy150Open openstack/nova/nova/network/linux_net.py/get_dhcp_leases