diff --git a/hooks/amqp-relation-departed b/hooks/amqp-relation-departed new file mode 120000 index 00000000..3ba0bdea --- /dev/null +++ b/hooks/amqp-relation-departed @@ -0,0 +1 @@ +nova_compute_hooks.py \ No newline at end of file diff --git a/hooks/nova_compute_hooks.py b/hooks/nova_compute_hooks.py index 58482b50..d6ddfea2 100755 --- a/hooks/nova_compute_hooks.py +++ b/hooks/nova_compute_hooks.py @@ -109,6 +109,20 @@ 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' and neutron_plugin() == 'ovs': + CONFIGS.write(QUANTUM_CONF) + if network_manager() == 'neutron' and neutron_plugin() == 'ovs': + CONFIGS.write(NEUTRON_CONF) + + @hooks.hook('shared-db-relation-joined') def db_joined(rid=None): relation_set(relation_id=rid,