Merge lp:~jjo/charms/trusty/rabbitmq-server/fix-nodename-to-host-dns-PTR into lp:charms/trusty/rabbitmq-server

Proposed by JuanJo Ciarlante
Status: Merged
Merged at revision: 62
Proposed branch: lp:~jjo/charms/trusty/rabbitmq-server/fix-nodename-to-host-dns-PTR
Merge into: lp:charms/trusty/rabbitmq-server
Diff against target: 33 lines (+16/-0)
1 file modified
hooks/rabbitmq_server_relations.py (+16/-0)
To merge this branch: bzr merge lp:~jjo/charms/trusty/rabbitmq-server/fix-nodename-to-host-dns-PTR
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review Queue (community) automated testing Needs Fixing
Review via email: mp+236041@code.launchpad.net

Commit message

[jjo] fixup rabbitmq nodename to DNS's PTR for node ip, to make it match peer's join_cluster.
Seems to fix lp#1342539.

To post a comment you must log in.
60. By David Britton

resync charmhelpers, make use of version compare from charmhelpers. [r=dpb] [a=tribaal]

Revision history for this message
Review Queue (review-queue) wrote :

This items has failed automated testing! Results available here http://reports.vapour.ws/charm-tests/charm-bundle-test-1114-results

review: Needs Fixing (automated testing)
61. By Liam Young

[davidpbritton, r=hopem, r=gnuoy]
- make use of new compare_versions logic in charm helpers (fixing lp:1375084)
- add unit test for the same

62. By JuanJo Ciarlante

[jjo] fixup rabbitmq nodename to DNS's PTR for node ip, to make it match peer's join_cluster

Revision history for this message
JuanJo Ciarlante (jjo) wrote :

Fixed text conflicts by resyncing over r61, PTAL.

Revision history for this message
Liam Young (gnuoy) wrote :

Approved

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/rabbitmq_server_relations.py'
--- hooks/rabbitmq_server_relations.py 2014-09-29 03:59:17 +0000
+++ hooks/rabbitmq_server_relations.py 2014-10-01 11:55:45 +0000
@@ -15,6 +15,10 @@
15 is_clustered,15 is_clustered,
16 eligible_leader16 eligible_leader
17)17)
18from charmhelpers.contrib.openstack.utils import (
19 get_hostname,
20 get_host_ip
21)
1822
19import charmhelpers.contrib.storage.linux.ceph as ceph23import charmhelpers.contrib.storage.linux.ceph as ceph
20from charmhelpers.contrib.openstack.utils import save_script_rc24from charmhelpers.contrib.openstack.utils import save_script_rc
@@ -146,6 +150,18 @@
146 'rabbitmq cluster config.')150 'rabbitmq cluster config.')
147 return151 return
148152
153 # Set RABBITMQ_NODENAME to something that's resolvable by my peers
154 # get_host_ip() is called to sanitize private-address in case it
155 # doesn't return an IP address
156 nodename = get_hostname(get_host_ip(unit_get('private-address')),
157 fqdn=False)
158 if nodename:
159 log('forcing nodename=%s' % nodename)
160 # need to stop it under current nodename
161 service_stop('rabbitmq-server')
162 rabbit.set_node_name('rabbit@%s' % nodename)
163 service_restart('rabbitmq-server')
164
149 if is_newer():165 if is_newer():
150 log('cluster_joined: Relation greater.')166 log('cluster_joined: Relation greater.')
151 return167 return

Subscribers

People subscribed via source and target branches