diff --git a/hooks/quantum_hooks.py b/hooks/quantum_hooks.py index 10f7d3a2..a11a68ff 100755 --- a/hooks/quantum_hooks.py +++ b/hooks/quantum_hooks.py @@ -111,6 +111,15 @@ def amqp_joined(relation_id=None): vhost=config('rabbit-vhost')) +@hooks.hook('amqp-relation-departed') +@restart_on_change(restart_map()) +def amqp_departed(): + if 'amqp' not in CONFIGS.complete_contexts(): + juju_log('amqp relation incomplete. Peer not ready?') + return + CONFIGS.write_all() + + @hooks.hook('shared-db-relation-changed', 'amqp-relation-changed', 'cluster-relation-changed',