diff --git a/hooks/keystone_hooks.py b/hooks/keystone_hooks.py index f51922ed..bda22268 100755 --- a/hooks/keystone_hooks.py +++ b/hooks/keystone_hooks.py @@ -146,8 +146,6 @@ from charmhelpers.contrib.openstack.ip import ( from charmhelpers.contrib.network.ip import ( get_iface_for_address, get_netmask_for_address, - get_address_in_network, - get_ipv6_addr, is_ipv6, get_relation_ip, ) @@ -559,15 +557,13 @@ def cluster_joined(rid=None, ssl_sync_request=True): settings = {} for addr_type in ADDRESS_TYPES: - address = get_address_in_network( - config('os-{}-network'.format(addr_type)) - ) + address = get_relation_ip( + addr_type, + cidr_network=config('os-{}-network'.format(addr_type))) if address: settings['{}-address'.format(addr_type)] = address - if config('prefer-ipv6'): - private_addr = get_ipv6_addr(exc_list=[config('vip')])[0] - settings['private-address'] = private_addr + settings['private-address'] = get_relation_ip('cluster') relation_set(relation_id=rid, relation_settings=settings) diff --git a/unit_tests/test_keystone_hooks.py b/unit_tests/test_keystone_hooks.py index d766404f..966562bc 100644 --- a/unit_tests/test_keystone_hooks.py +++ b/unit_tests/test_keystone_hooks.py @@ -102,7 +102,6 @@ TO_PATCH = [ # ip 'get_iface_for_address', 'get_netmask_for_address', - 'get_address_in_network', 'git_install', 'is_service_present', 'delete_service_entry',