added amqp relation departed

This commit is contained in:
yolanda.robla@canonical.com 2014-01-30 12:26:36 +01:00
parent d07048b693
commit d34dbddedf
2 changed files with 14 additions and 0 deletions

View File

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

View File

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