Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
from charmhelpers.core.hookenv import relation_ids, related_units, relation_get
for rid in relation_ids('database'):
for u in related_units(rid):
print('Hostname: %s' % relation_get('hostname', unit=u, rid=rid))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment