Merge lp:~tribaal/charms/trusty/rabbitmq-server/add-extra-logging into lp:~openstack-charmers-archive/charms/trusty/rabbitmq-server/next

Proposed by Chris Glass
Status: Merged
Merged at revision: 119
Proposed branch: lp:~tribaal/charms/trusty/rabbitmq-server/add-extra-logging
Merge into: lp:~openstack-charmers-archive/charms/trusty/rabbitmq-server/next
Diff against target: 36 lines (+4/-2)
2 files modified
hooks/rabbit_utils.py (+1/-1)
hooks/rabbitmq_server_relations.py (+3/-1)
To merge this branch: bzr merge lp:~tribaal/charms/trusty/rabbitmq-server/add-extra-logging
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+274278@code.launchpad.net

Description of the change

This branch addresses some of the review comments from https://code.launchpad.net/~tribaal/charms/trusty/rabbitmq-server/backport-lp1500204/+merge/273958

This addresses the logging part in order to make for an easy backport to -stable.

To post a comment you must log in.
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/rabbit_utils.py'
--- hooks/rabbit_utils.py 2015-10-06 21:52:17 +0000
+++ hooks/rabbit_utils.py 2015-10-13 15:41:33 +0000
@@ -312,13 +312,13 @@
312 if node in running_nodes():312 if node in running_nodes():
313 log('Host already clustered with %s.' % node)313 log('Host already clustered with %s.' % node)
314 return False314 return False
315 log('Clustering with remote rabbit host (%s).' % node)
316 # NOTE: The primary problem rabbitmq has clustering is when315 # NOTE: The primary problem rabbitmq has clustering is when
317 # more than one node attempts to cluster at the same time.316 # more than one node attempts to cluster at the same time.
318 # The asynchronous nature of hook firing nearly guarantees317 # The asynchronous nature of hook firing nearly guarantees
319 # this. Using random time wait is a hack until we can318 # this. Using random time wait is a hack until we can
320 # implement charmhelpers.coordinator.319 # implement charmhelpers.coordinator.
321 time.sleep(random.random()*100)320 time.sleep(random.random()*100)
321 log('Clustering with remote rabbit host (%s).' % node)
322 try:322 try:
323 cmd = [RABBITMQ_CTL, 'stop_app']323 cmd = [RABBITMQ_CTL, 'stop_app']
324 subprocess.check_call(cmd)324 subprocess.check_call(cmd)
325325
=== modified file 'hooks/rabbitmq_server_relations.py'
--- hooks/rabbitmq_server_relations.py 2015-10-06 18:55:33 +0000
+++ hooks/rabbitmq_server_relations.py 2015-10-13 15:41:33 +0000
@@ -261,10 +261,12 @@
261 min_size = config('min-cluster-size')261 min_size = config('min-cluster-size')
262 if min_size:262 if min_size:
263 # Ignore min-cluster-size if juju has leadership election263 # Ignore min-cluster-size if juju has leadership election
264 try: 264 try:
265 is_leader()265 is_leader()
266 log("Ignoring min-cluster-size in favour of Juju leader election")
266 return True267 return True
267 except NotImplementedError:268 except NotImplementedError:
269 log("Leader election is not available, using min-cluster-size")
268 size = 0270 size = 0
269 for rid in relation_ids('cluster'):271 for rid in relation_ids('cluster'):
270 size = len(related_units(rid))272 size = len(related_units(rid))

Subscribers

People subscribed via source and target branches