~gandelman-a/charms/precise/keystone/config-changed

« back to all changes in this revision

Viewing changes to hooks/utils.py

  • Committer: Adam Gandelman
  • Date: 2012-01-12 16:45:13 UTC
  • Revision ID: adamg@canonical.com-20120112164513-s0tlws1pftfvnfci
Get rid of dig usage

Show diffs side-by-side

added added

removed removed

Lines of Context:
91
91
            error_out("ERROR: Config option has no paramter: %s" % c)
92
92
    # tack on our private address and ip
93
93
    hostname = execute("unit-get private-address")[0].strip()
94
 
    ip = execute("dig +short %s" % hostname, die=True)[0].strip()
95
 
    config["hostname"] = hostname
96
 
    config["ip"] = ip
 
94
    config["hostname"] = execute("unit-get private-address")[0].strip()
97
95
    return config
98
96
 
99
97
def relation_set(relation_data):
258
256
 
259
257
    # following documentation here, perhaps we should be using juju
260
258
    # public/private addresses for public/internal urls.
261
 
    public_url = "http://%s:%s/v2.0" % (config["ip"], config["service-port"])
262
 
    admin_url = "http://%s:%s/v2.0" % (config["ip"], config["admin-port"])
263
 
    internal_url = "http://%s:%s/v2.0" % (config["ip"], config["service-port"])
 
259
    public_url = "http://%s:%s/v2.0" % (config["hostname"], config["service-port"])
 
260
    admin_url = "http://%s:%s/v2.0" % (config["hostname"], config["admin-port"])
 
261
    internal_url = "http://%s:%s/v2.0" % (config["hostname"], config["service-port"])
264
262
    create_endpoint_template(manager, "RegionOne", "keystone", public_url,
265
263
                             admin_url, internal_url)