Move NEUTRON_CONF out of the way which as the benefit of triggering a neutron restart on api relation break

This commit is contained in:
Liam Young 2014-05-15 14:58:51 +00:00
parent ce1fe0d102
commit cf5c000e2c
2 changed files with 5 additions and 3 deletions

View File

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

View File

@ -510,22 +510,23 @@ def upgrade_charm():
def neutron_api_relation_joined():
with open('/etc/init/neutron-server.override', 'wb') as out:
out.write('manual\n')
os.rename(NEUTRON_CONF, NEUTRON_CONF + '_unused')
if service_running('neutron-server'):
service_stop('neutron-server')
for rid in relation_ids('identity-service'):
identity_joined(rid=rid)
@hooks.hook('neutron-api-relation-changed')
@restart_on_change(restart_map())
def neutron_api_relation_changed():
CONFIGS.write(NOVA_CONF)
@hooks.hook('neutron-api-relation-broken')
@restart_on_change(restart_map())
def neutron_api_relation_broken():
CONFIGS.write_all()
if os.path.isfile('/etc/init/neutron-server.override'):
os.remove('/etc/init/neutron-server.override')
if not service_running('neutron-server'):
service_start('neutron-server')
CONFIGS.write_all()
def main():
try: