Fixup bug in shared-db and postgresql changed hooks - neutron uses the db as well

This commit is contained in:
James Page 2014-04-11 17:41:42 +01:00
parent 4e0d91c32f
commit 21e62168fe
2 changed files with 4 additions and 11 deletions

View File

@ -176,12 +176,7 @@ def db_changed():
if 'shared-db' not in CONFIGS.complete_contexts():
log('shared-db relation incomplete. Peer not ready?')
return
CONFIGS.write(NOVA_CONF)
if network_manager() in ['neutron', 'quantum']:
plugin = neutron_plugin()
# DB config might have been moved to main neutron.conf in H?
CONFIGS.write(neutron_plugin_attribute(plugin, 'config'))
CONFIGS.write_all()
if eligible_leader(CLUSTER_RES):
migrate_database()
@ -196,7 +191,7 @@ def postgresql_nova_db_changed():
if 'pgsql-nova-db' not in CONFIGS.complete_contexts():
log('pgsql-nova-db relation incomplete. Peer not ready?')
return
CONFIGS.write(NOVA_CONF)
CONFIGS.write_all()
if eligible_leader(CLUSTER_RES):
migrate_database()

View File

@ -223,13 +223,11 @@ class NovaCCHooksTests(CharmTestCase):
@patch.object(hooks, 'CONFIGS')
def test_db_changed(self, configs):
self._shared_db_test(configs)
self.assertEquals([call('/etc/nova/nova.conf')],
configs.write.call_args_list)
self.assertTrue(configs.write_all.called)
self.migrate_database.assert_called_with()
@patch.object(hooks, 'CONFIGS')
def test_postgresql_db_changed(self, configs):
self._postgresql_db_test(configs)
self.assertEquals([call('/etc/nova/nova.conf')],
configs.write.call_args_list)
self.assertTrue(configs.write_all.called)
self.migrate_database.assert_called_with()