From 9c80d8db6573b5abade7fc1051f19c7e3e900638 Mon Sep 17 00:00:00 2001 From: "james.page@ubuntu.com" <> Date: Wed, 11 Mar 2015 16:11:55 +0000 Subject: [PATCH] Break cluster when relation is broken, as this will be run on the unit that's just been removed --- ...ter-relation-departed => cluster-relation-broken} | 0 hooks/rabbitmq_server_relations.py | 12 ++---------- 2 files changed, 2 insertions(+), 10 deletions(-) rename hooks/{cluster-relation-departed => cluster-relation-broken} (100%) diff --git a/hooks/cluster-relation-departed b/hooks/cluster-relation-broken similarity index 100% rename from hooks/cluster-relation-departed rename to hooks/cluster-relation-broken diff --git a/hooks/rabbitmq_server_relations.py b/hooks/rabbitmq_server_relations.py index f0712ae3..b98fc577 100755 --- a/hooks/rabbitmq_server_relations.py +++ b/hooks/rabbitmq_server_relations.py @@ -312,16 +312,8 @@ def update_cookie(): service_restart('rabbitmq-server') -@hooks.hook('cluster-relation-departed') -def cluster_departed(): - if is_relation_made('ha') and \ - config('ha-vip-only') is False: - log('hacluster relation is present, skipping native ' - 'rabbitmq cluster config.') - return - if not is_newer(): - log('cluster_joined: Relation lesser.') - return +@hooks.hook('cluster-relation-broken') +def cluster_broken(): rabbit.break_cluster()