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