added amqp relation departed

This commit is contained in:
yolanda.robla@canonical.com 2014-01-30 12:46:46 +01:00
parent 020c2a0ef7
commit 466419c097
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1 @@
nova_compute_hooks.py

View File

@ -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,