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:
Paul Collins 2012-10-03 02:43:41 +13:00
parent 1e5508baef
commit 425a44277d
2 changed files with 5 additions and 3 deletions

View File

@ -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

View File

@ -1 +1 @@
17
18