Deal with IPv6 addresses
This commit is contained in:
parent
b8188dea95
commit
2074268f9c
@ -130,14 +130,19 @@ def config_changed():
|
||||
|
||||
def get_mon_hosts():
|
||||
hosts = []
|
||||
hosts.append('{}:6789'.format(get_public_addr()))
|
||||
addr = get_public_addr()
|
||||
if is_ipv6(addr):
|
||||
hosts.append('[{}]:6789'.format(addr))
|
||||
else:
|
||||
hosts.append('{}:6789'.format(addr))
|
||||
|
||||
for relid in relation_ids('mon'):
|
||||
for unit in related_units(relid):
|
||||
addr = relation_get('ceph-public-address', unit, relid)
|
||||
if is_ipv6(addr):
|
||||
addr = '[{}]'.format(addr)
|
||||
if addr is not None:
|
||||
if is_ipv6(addr):
|
||||
hosts.append('[{}]:6789'.format(addr))
|
||||
else:
|
||||
hosts.append('{}:6789'.format(addr))
|
||||
|
||||
hosts.sort()
|
||||
|
Loading…
Reference in New Issue
Block a user