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.
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') ] admin.local' ), ('10.5.0.32', 'keystone. int.local' ), ('10.5.0.32', 'keystone. public. local') ]
2021-03-22 18:58:23 ERROR juju-log debug sorted: [('10.5.0.32', 'keystone.
Then later for loop inside __call__() consume everything as is and create more vhosts than it should.
addresses = self.get_ network_ addresses( ) 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))
for address, endpoint in addresses:
for api_port in self.external_
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.