Merge lp:~1chb1n/charm-helpers/os-amulet-keystone-pub-addr into lp:charm-helpers

Proposed by Ryan Beisner
Status: Merged
Merged at revision: 645
Proposed branch: lp:~1chb1n/charm-helpers/os-amulet-keystone-pub-addr
Merge into: lp:charm-helpers
Diff against target: 21 lines (+2/-2)
1 file modified
charmhelpers/contrib/openstack/amulet/utils.py (+2/-2)
To merge this branch: bzr merge lp:~1chb1n/charm-helpers/os-amulet-keystone-pub-addr
Reviewer Review Type Date Requested Status
charmers Pending
Review via email: mp+307639@code.launchpad.net

Description of the change

Use public-address in OpenStack Amulet keystone address helper

'private-address' is not always present, even after a deployment is completely settled.

Here is a dump of all keys from sentry.info:

DEBUG:amulet-logger:['machine', 'open-ports', 'public-address', 'service', 'workload-status', 'agent-status', 'unit_name', 'agent-state', 'unit', 'agent-version']

Given that sentry.info is just a copy of the juju status yaml data, when juju status has no private-address to report, it is also not present.

More detail and an example at:

http://pastebin.ubuntu.com/23277010/

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'charmhelpers/contrib/openstack/amulet/utils.py'
2--- charmhelpers/contrib/openstack/amulet/utils.py 2016-10-04 14:04:01 +0000
3+++ charmhelpers/contrib/openstack/amulet/utils.py 2016-10-04 21:58:31 +0000
4@@ -306,7 +306,7 @@
5 password, tenant):
6 """Authenticates admin user with cinder."""
7 # NOTE(beisner): cinder python client doesn't accept tokens.
8- keystone_ip = keystone_sentry.info['private-address']
9+ keystone_ip = keystone_sentry.info['public-address']
10 ept = "http://{}:5000/v2.0".format(keystone_ip.strip().decode('utf-8'))
11 return cinder_client.Client(username, password, tenant, ept)
12
13@@ -317,7 +317,7 @@
14 self.log.debug('Authenticating keystone admin...')
15 unit = keystone_sentry
16 if not keystone_ip:
17- keystone_ip = keystone_sentry.info['private-address']
18+ keystone_ip = keystone_sentry.info['public-address']
19
20 base_ep = "http://{}:35357".format(keystone_ip.strip().decode('utf-8'))
21 if not api_version or api_version == 2:

Subscribers

People subscribed via source and target branches