Excludes vip from get_ipv6_addr().
This commit is contained in:
parent
cd3e704c14
commit
810dfa0218
|
@ -414,10 +414,12 @@ class HAProxyContext(OSContextGenerator):
|
|||
|
||||
cluster_hosts = {}
|
||||
l_unit = local_unit().replace('/', '-')
|
||||
|
||||
if config('prefer-ipv6'):
|
||||
addr = get_ipv6_addr()[0]
|
||||
addr = get_ipv6_addr(exc_list=[config('vip')])[0]
|
||||
else:
|
||||
addr = unit_get('private-address')
|
||||
|
||||
cluster_hosts[l_unit] = get_address_in_network(config('os-internal-network'),
|
||||
addr)
|
||||
|
||||
|
|
|
@ -66,7 +66,10 @@ def resolve_address(endpoint_type=PUBLIC):
|
|||
resolved_address = vip
|
||||
else:
|
||||
if config('prefer-ipv6'):
|
||||
fallback_addr = get_ipv6_addr()
|
||||
list = []
|
||||
if config('vip'):
|
||||
list.append(config('vip'))
|
||||
fallback_addr = get_ipv6_addr(exc_list=list)[0]
|
||||
else:
|
||||
fallback_addr = unit_get(_address_map[endpoint_type]['fallback'])
|
||||
resolved_address = get_address_in_network(
|
||||
|
|
|
@ -121,7 +121,7 @@ class SwiftRingContext(OSContextGenerator):
|
|||
for unit in related_units(relid):
|
||||
host = relation_get('private-address', unit, relid)
|
||||
if config('prefer-ipv6'):
|
||||
host_ip = get_ipv6_addr()[0]
|
||||
host_ip = get_ipv6_addr(exc_list=[config('vip')])[0]
|
||||
else:
|
||||
host_ip = get_host_ip(host)
|
||||
allowed_hosts.append(host_ip)
|
||||
|
@ -143,7 +143,7 @@ class SwiftIdentityContext(OSContextGenerator):
|
|||
import multiprocessing
|
||||
workers = multiprocessing.cpu_count()
|
||||
if config('prefer-ipv6'):
|
||||
proxy_ip = '[%s]' % get_ipv6_addr()[0]
|
||||
proxy_ip = '[%s]' % get_ipv6_addr(exc_list=[config('vip')])[0]
|
||||
memcached_ip = 'ip6-localhost'
|
||||
else:
|
||||
proxy_ip = get_host_ip(unit_get('private-address'))
|
||||
|
|
|
@ -154,7 +154,7 @@ def balance_rings():
|
|||
if cluster.is_clustered():
|
||||
hostname = config('vip')
|
||||
elif config('prefer-ipv6'):
|
||||
hostname = get_ipv6_addr()[0]
|
||||
hostname = get_ipv6_addr(exc_list=[config('vip')])[0]
|
||||
else:
|
||||
hostname = unit_get('private-address')
|
||||
|
||||
|
@ -233,9 +233,9 @@ def config_changed():
|
|||
def cluster_changed():
|
||||
if config('prefer-ipv6'):
|
||||
for rid in relation_ids('cluster'):
|
||||
addr = get_ipv6_addr(exc_list=[config('vip')])[0]
|
||||
relation_set(relation_id=rid,
|
||||
relation_settings={'private-address':
|
||||
get_ipv6_addr()[0]})
|
||||
relation_settings={'private-address': addr})
|
||||
|
||||
CONFIGS.write_all()
|
||||
|
||||
|
|
Loading…
Reference in New Issue