From 7b6f93fc11f627a8f3d48a7a1b9171e97f54254b Mon Sep 17 00:00:00 2001 From: Edward Hope-Morley Date: Mon, 11 Mar 2019 18:06:14 +0000 Subject: [PATCH] Remove keepalived purge when dvr enabled Stop the charm from uninstalling keepalived when using dvr since it also removes neutron-l3-agent. Change-Id: I62d4cd2ee635ce793e37d4760387047b1b38f973 Closes-Bug: #1819499 --- hooks/neutron_ovs_hooks.py | 5 +++-- unit_tests/test_neutron_ovs_hooks.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hooks/neutron_ovs_hooks.py b/hooks/neutron_ovs_hooks.py index 0d28d8e9..4fa7690a 100755 --- a/hooks/neutron_ovs_hooks.py +++ b/hooks/neutron_ovs_hooks.py @@ -146,8 +146,9 @@ def neutron_plugin_api_changed(): if (use_l3ha() and CompareOpenStackReleases(_os_release) >= 'newton'): install_l3ha_packages() - else: - packages_to_purge.extend(L3HA_PACKAGES) + + # NOTE(hopem): don't uninstall keepalived if not using l3ha since that + # results in neutron-l3-agent also being uninstalled (see LP 1819499). else: packages_to_purge = deepcopy(DVR_PACKAGES) packages_to_purge.extend(L3HA_PACKAGES) diff --git a/unit_tests/test_neutron_ovs_hooks.py b/unit_tests/test_neutron_ovs_hooks.py index c88b927f..a8c9766d 100644 --- a/unit_tests/test_neutron_ovs_hooks.py +++ b/unit_tests/test_neutron_ovs_hooks.py @@ -219,7 +219,7 @@ class NeutronOVSHooksTests(CharmTestCase): self.configure_ovs.assert_called_with() self.assertTrue(self.CONFIGS.write_all.called) _plugin_joined.assert_called_with(relation_id='rid') - self.purge_packages.assert_called_with(['keepalived']) + self.purge_packages.assert_not_called() @patch.object(hooks, 'os_release') @patch.object(hooks, 'neutron_plugin_joined')