append port to the monitor addresses, and rewrite ceph.conf from the upgrade-charm hook

This commit is contained in:
Paul Collins
2012-10-03 04:12:49 +13:00
parent 4600527dc8
commit 518bb52d4e
2 changed files with 16 additions and 7 deletions

View File

@@ -54,12 +54,15 @@ def config_changed():
def get_mon_hosts():
hosts = []
hosts.append(socket.gethostbyname(utils.unit_get('private-address')))
hosts.append(socket.gethostbyname(utils.unit_get('private-address'))
+ ':6789')
for relid in utils.relation_ids("mon"):
for unit in utils.relation_list(relid):
hosts.append(socket.gethostbyname(
utils.relation_get('private-address', unit, relid)))
hosts.append(
socket.gethostbyname(utils.relation_get('private-address',
unit, relid))
+ ':6789')
return hosts
@@ -68,12 +71,18 @@ def mon_relation():
emit_cephconf()
utils.juju_log('INFO', 'End mon-relation hook.')
def upgrade_charm():
utils.juju_log('INFO', 'Begin upgrade-charm hook.')
emit_cephconf()
utils.juju_log('INFO', 'End upgrade-charm hook.')
hooks = {
'mon-relation-joined': mon_relation,
'config-changed': config_changed,
'install': install,
'mon-relation-changed': mon_relation,
'mon-relation-departed': mon_relation,
'install': install,
'config-changed': config_changed,
'mon-relation-joined': mon_relation,
'upgrade-charm': upgrade_charm,
}
hook = os.path.basename(sys.argv[0])