From 425a44277d4d754fbb930f556027737a5bfd0e90 Mon Sep 17 00:00:00 2001 From: Paul Collins Date: Wed, 3 Oct 2012 02:43:41 +1300 Subject: [PATCH] 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 --- hooks/hooks.py | 6 ++++-- revision | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/hooks/hooks.py b/hooks/hooks.py index 434c0f9..1fe27ce 100755 --- a/hooks/hooks.py +++ b/hooks/hooks.py @@ -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 diff --git a/revision b/revision index 98d9bcb..3c03207 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -17 +18