def _output_addn_hosts_file(self):
        buf = six.StringIO()
        for host_tuple in self._iter_hosts():
            port, alloc, hostname, fqdn, no_dhcp, no_opts = host_tuple
            # It is compulsory to write the `fqdn` before the `hostname` in
            # order to obtain it in PTR responses.
            if alloc:
                buf.write('%s\t%s %s\n' % (alloc.ip_address, fqdn, hostname))
        addn_hosts = self.get_conf_file_name('addn_hosts')
        common_utils.replace_file(addn_hosts, buf.getvalue())
        return addn_hosts
Writes a dnsmasq compatible additional hosts file.
dataset/ETHPy150Open openstack/neutron/neutron/agent/linux/dhcp.py/Dnsmasq._output_addn_hosts_file