Use get_ipv6_addr()[0] directly.
This commit is contained in:
@@ -415,7 +415,7 @@ class HAProxyContext(OSContextGenerator):
|
||||
cluster_hosts = {}
|
||||
l_unit = local_unit().replace('/', '-')
|
||||
if config('prefer-ipv6'):
|
||||
addr = get_ipv6_addr()
|
||||
addr = get_ipv6_addr()[0]
|
||||
else:
|
||||
addr = unit_get('private-address')
|
||||
cluster_hosts[l_unit] = get_address_in_network(config('os-internal-network'),
|
||||
|
||||
@@ -167,7 +167,7 @@ def canonical_url(vip_setting='vip'):
|
||||
if is_clustered():
|
||||
addr = '[%s]' % config(vip_setting)
|
||||
else:
|
||||
addr = '[%s]' % get_ipv6_addr()
|
||||
addr = '[%s]' % get_ipv6_addr()[0]
|
||||
else:
|
||||
if is_clustered():
|
||||
addr = config(vip_setting)
|
||||
|
||||
@@ -191,7 +191,7 @@ def db_joined():
|
||||
raise Exception(e)
|
||||
|
||||
if config('prefer-ipv6'):
|
||||
host = get_ipv6_addr()
|
||||
host = get_ipv6_addr()[0]
|
||||
else:
|
||||
host = unit_get('private-address')
|
||||
|
||||
@@ -563,7 +563,7 @@ def cluster_changed():
|
||||
for rid in relation_ids('cluster'):
|
||||
relation_set(relation_id=rid,
|
||||
relation_settings={'private-address':
|
||||
get_ipv6_addr()})
|
||||
get_ipv6_addr()[0]})
|
||||
|
||||
CONFIGS.write_all()
|
||||
if is_relation_made('cluster'):
|
||||
|
||||
Reference in New Issue
Block a user