From ad6fbd48db1797e1cfe201e158331edef205a1f1 Mon Sep 17 00:00:00 2001 From: James Page Date: Thu, 2 Feb 2017 12:42:07 +0000 Subject: [PATCH] Ensure configuration changes propagated fully nova-cloud-controller provides its region setting to the nova services hosted in neutron-gateway units; ensure that any changes to configuration are correctly propagated to related units. Change-Id: Iea002d4379339abf64742409e36d237b163420c5 Closes-Bug: 1513411 --- hooks/nova_cc_hooks.py | 2 ++ unit_tests/test_nova_cc_hooks.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hooks/nova_cc_hooks.py b/hooks/nova_cc_hooks.py index 263b3f76..fe6ebe5c 100755 --- a/hooks/nova_cc_hooks.py +++ b/hooks/nova_cc_hooks.py @@ -272,6 +272,8 @@ def config_changed(): if filtered: apt_install(filtered, fatal=True) + for rid in relation_ids('quantum-network-service'): + quantum_joined(rid=rid) for r_id in relation_ids('identity-service'): identity_joined(rid=r_id) for rid in relation_ids('zeromq-configuration'): diff --git a/unit_tests/test_nova_cc_hooks.py b/unit_tests/test_nova_cc_hooks.py index b433ab8d..50261486 100644 --- a/unit_tests/test_nova_cc_hooks.py +++ b/unit_tests/test_nova_cc_hooks.py @@ -206,6 +206,7 @@ class NovaCCHooksTests(CharmTestCase): self.git_install.assert_called_with(projects_yaml) self.assertFalse(self.do_openstack_upgrade.called) + @patch.object(hooks, 'quantum_joined') @patch.object(hooks, 'determine_packages') @patch.object(utils, 'service_resume') @patch('charmhelpers.contrib.openstack.ip.unit_get') @@ -225,7 +226,8 @@ class NovaCCHooksTests(CharmTestCase): utils_config, mock_relids, mock_unit_get, mock_service_resume, - mock_determine_packages): + mock_determine_packages, + mock_quantum_joined): mock_determine_packages.return_value = [] self.git_install_requested.return_value = False self.openstack_upgrade_available.return_value = True @@ -244,6 +246,7 @@ class NovaCCHooksTests(CharmTestCase): self.assertTrue(db_joined.called) self.assertTrue(self.save_script_rc.called) mock_filter_packages.assert_called_with([]) + self.assertTrue(mock_quantum_joined.called) @patch.object(utils, 'service_resume') @patch.object(hooks, 'filter_installed_packages')