Remove lbaas in OpenStack Train deployments

This patch removes completely any lbaas related service when upgrading
to OpenStack Train.

Change-Id: I51a19e4890dfbc4c7cbb61b6d7fdfc7888ff9262
Closes-Bug: #1853868
Signed-off-by: Stamatis Katsaounis <skatsaounis@admin.grnet.gr>
This commit is contained in:
Stamatis Katsaounis 2019-11-29 11:04:53 +02:00
parent 836e701544
commit 5c5d5911a0
2 changed files with 39 additions and 2 deletions

View File

@ -295,10 +295,16 @@ def get_packages():
def get_purge_packages():
'''Return a list of packages to purge for the current OS release'''
plugin = config('plugin')
cmp_os_source = CompareOpenStackReleases(os_release('neutron-common'))
purge_packages_list = []
if cmp_os_source >= 'rocky':
return PURGE_PACKAGES
return []
purge_packages_list.extend(PURGE_PACKAGES)
if cmp_os_source >= 'train':
purge_packages_list.append('python3-neutron-lbaas')
if plugin in (OVS, OVS_ODL):
purge_packages_list.append('neutron-lbaasv2-agent')
return purge_packages_list
def remove_old_packages():

View File

@ -206,6 +206,37 @@ class TestNeutronUtils(CharmTestCase):
neutron_utils.get_purge_packages()
)
def test_get_purge_packages_ovs_train(self):
self.config.return_value = 'ovs'
self.os_release.return_value = 'train'
self.assertEqual([
'python-mysqldb',
'python-psycopg2',
'python-oslo.config',
'python-nova',
'python-neutron',
'python-neutron-fwaas',
'python-neutron-lbaas',
'python3-neutron-lbaas',
'neutron-lbaasv2-agent'],
neutron_utils.get_purge_packages()
)
def test_get_purge_packages_nsx_train(self):
self.config.return_value = 'nsx'
self.os_release.return_value = 'train'
self.assertEqual([
'python-mysqldb',
'python-psycopg2',
'python-oslo.config',
'python-nova',
'python-neutron',
'python-neutron-fwaas',
'python-neutron-lbaas',
'python3-neutron-lbaas'],
neutron_utils.get_purge_packages()
)
def test_get_packages_ovsodl_icehouse(self):
self.patch_object(neutron_utils, 'disable_nova_metadata',
return_value=False)