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
1=== modified file 'hooks/rabbit_utils.py'
2--- hooks/rabbit_utils.py 2015-10-06 21:52:17 +0000
3+++ hooks/rabbit_utils.py 2015-10-13 15:41:33 +0000
4@@ -312,13 +312,13 @@
5 if node in running_nodes():
6 log('Host already clustered with %s.' % node)
7 return False
8- log('Clustering with remote rabbit host (%s).' % node)
9 # NOTE: The primary problem rabbitmq has clustering is when
10 # more than one node attempts to cluster at the same time.
11 # The asynchronous nature of hook firing nearly guarantees
12 # this. Using random time wait is a hack until we can
13 # implement charmhelpers.coordinator.
14 time.sleep(random.random()*100)
15+ log('Clustering with remote rabbit host (%s).' % node)
16 try:
17 cmd = [RABBITMQ_CTL, 'stop_app']
18 subprocess.check_call(cmd)
19
20=== modified file 'hooks/rabbitmq_server_relations.py'
21--- hooks/rabbitmq_server_relations.py 2015-10-06 18:55:33 +0000
22+++ hooks/rabbitmq_server_relations.py 2015-10-13 15:41:33 +0000
23@@ -261,10 +261,12 @@
24 min_size = config('min-cluster-size')
25 if min_size:
26 # Ignore min-cluster-size if juju has leadership election
27- try:
28+ try:
29 is_leader()
30+ log("Ignoring min-cluster-size in favour of Juju leader election")
31 return True
32 except NotImplementedError:
33+ log("Leader election is not available, using min-cluster-size")
34 size = 0
35 for rid in relation_ids('cluster'):
36 size = len(related_units(rid))

Subscribers

People subscribed via source and target branches