From 2da9bb4efdfb282b66519aadd97449da69eb8f16 Mon Sep 17 00:00:00 2001 From: Adam Gandelman Date: Thu, 12 Jan 2012 08:45:13 -0800 Subject: [PATCH] Get rid of dig usage --- hooks/utils.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/hooks/utils.py b/hooks/utils.py index 80344d54..1d1dc568 100755 --- a/hooks/utils.py +++ b/hooks/utils.py @@ -91,9 +91,7 @@ def config_get(): error_out("ERROR: Config option has no paramter: %s" % c) # tack on our private address and ip hostname = execute("unit-get private-address")[0].strip() - ip = execute("dig +short %s" % hostname, die=True)[0].strip() - config["hostname"] = hostname - config["ip"] = ip + config["hostname"] = execute("unit-get private-address")[0].strip() return config def relation_set(relation_data): @@ -258,8 +256,8 @@ def ensure_initial_admin(config): # following documentation here, perhaps we should be using juju # public/private addresses for public/internal urls. - public_url = "http://%s:%s/v2.0" % (config["ip"], config["service-port"]) - admin_url = "http://%s:%s/v2.0" % (config["ip"], config["admin-port"]) - internal_url = "http://%s:%s/v2.0" % (config["ip"], config["service-port"]) + public_url = "http://%s:%s/v2.0" % (config["hostname"], config["service-port"]) + admin_url = "http://%s:%s/v2.0" % (config["hostname"], config["admin-port"]) + internal_url = "http://%s:%s/v2.0" % (config["hostname"], config["service-port"]) create_endpoint_template(manager, "RegionOne", "keystone", public_url, admin_url, internal_url)