Comment 4 for bug 1919148

Revision history for this message
Eric Desrochers (slashd) wrote :

Instrumenting a local charm revealed that after the sorted() and set(), get_network_addresses() returns:

2021-03-22 18:58:23 ERROR juju-log debug unsorted: [('10.5.0.32', 'keystone.int.local'), ('10.5.0.32', 'keystone.admin.local'), ('10.5.0.32', 'keystone.public.local')]
2021-03-22 18:58:23 ERROR juju-log debug sorted: [('10.5.0.32', 'keystone.admin.local'), ('10.5.0.32', 'keystone.int.local'), ('10.5.0.32', 'keystone.public.local')]

Then later for loop inside __call__() consume everything as is and create more vhosts than it should.

        addresses = self.get_network_addresses()
        for address, endpoint in addresses:
            for api_port in self.external_ports:
                ext_port = determine_apache_port(api_port,
                                                 singlenode_mode=True)
                int_port = determine_api_port(api_port, singlenode_mode=True)
                portmap = (address, endpoint, int(ext_port), int(int_port))
                ctxt['endpoints'].append(portmap)
                ctxt['ext_ports'].append(int(ext_port))

        ctxt['ext_ports'] = sorted(list(set(ctxt['ext_ports'])))
        return ctxt

So it is working fine if no hostname(s) are config set in keystone, but as soon as it is, the charm cannot handle it logically.