From d34dbddedf89b78bd909242af352d68bdc583610 Mon Sep 17 00:00:00 2001 From: "yolanda.robla@canonical.com" <> Date: Thu, 30 Jan 2014 12:26:36 +0100 Subject: [PATCH] added amqp relation departed --- hooks/amqp-relation-departed | 1 + hooks/nova_cc_hooks.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 120000 hooks/amqp-relation-departed diff --git a/hooks/amqp-relation-departed b/hooks/amqp-relation-departed new file mode 120000 index 00000000..f6702415 --- /dev/null +++ b/hooks/amqp-relation-departed @@ -0,0 +1 @@ +nova_cc_hooks.py \ No newline at end of file diff --git a/hooks/nova_cc_hooks.py b/hooks/nova_cc_hooks.py index 72365a3c..153d49b4 100755 --- a/hooks/nova_cc_hooks.py +++ b/hooks/nova_cc_hooks.py @@ -122,6 +122,19 @@ def amqp_changed(): CONFIGS.write(NEUTRON_CONF) +@hooks.hook('amqp-relation-departed') +@restart_on_change(restart_map()) +def amqp_departed(): + if 'amqp' not in CONFIGS.complete_contexts(): + log('amqp relation incomplete. Peer not ready?') + return + CONFIGS.write(NOVA_CONF) + if network_manager() == 'quantum': + CONFIGS.write(QUANTUM_CONF) + if network_manager() == 'neutron': + CONFIGS.write(NEUTRON_CONF) + + @hooks.hook('shared-db-relation-joined') def db_joined(): relation_set(nova_database=config('database'),