coerce private-address to an address with the magic of gethostbyname
private-address may or may not be an address - it depends on the juju provider in use
This commit is contained in:
parent
1e5508baef
commit
425a44277d
|
@ -9,6 +9,7 @@
|
|||
|
||||
import os
|
||||
import subprocess
|
||||
import socket
|
||||
import sys
|
||||
|
||||
import ceph
|
||||
|
@ -42,11 +43,12 @@ def config_changed():
|
|||
|
||||
def get_mon_hosts():
|
||||
hosts = []
|
||||
hosts.append(utils.unit_get('private-address'))
|
||||
hosts.append(socket.gethostbyname(utils.unit_get('private-address')))
|
||||
|
||||
for relid in utils.relation_ids("mon"):
|
||||
for unit in utils.relation_list(relid):
|
||||
hosts.append(utils.relation_get('private-address', unit, relid))
|
||||
hosts.append(socket.gethostbyname(
|
||||
utils.relation_get('private-address', unit, relid)))
|
||||
|
||||
return hosts
|
||||
|
||||
|
|
Loading…
Reference in New Issue