Further changes for OpenStack Train
Drop installation and configuration of neutron-lbaasv2-agent for Train. Change-Id: I103c809f5f67ee797cc767bd58236601c16aeca5
This commit is contained in:
parent
75c4fac218
commit
776979801e
|
@ -276,6 +276,10 @@ def get_packages():
|
|||
# LBaaS v1 dropped in newton
|
||||
packages.remove('neutron-lbaas-agent')
|
||||
packages.append('neutron-lbaasv2-agent')
|
||||
if cmp_os_source >= 'train':
|
||||
# LBaaS v2 dropped in train
|
||||
packages.remove('neutron-lbaasv2-agent')
|
||||
|
||||
if disable_nova_metadata(cmp_os_source):
|
||||
packages.remove('nova-api-metadata')
|
||||
packages.extend(determine_l3ha_packages())
|
||||
|
@ -670,6 +674,13 @@ def resolve_config_files(plugin, release):
|
|||
else:
|
||||
drop_config.extend([NEUTRON_LBAAS_AA_PROFILE_PATH])
|
||||
|
||||
# Drop lbaasv2 at train
|
||||
if cmp_os_release >= 'train':
|
||||
drop_config.extend([
|
||||
NEUTRON_LBAASV2_AA_PROFILE_PATH,
|
||||
NEUTRON_LBAAS_AGENT_CONF,
|
||||
])
|
||||
|
||||
if disable_nova_metadata(cmp_os_release):
|
||||
drop_config.extend(get_nova_config_files().keys())
|
||||
else:
|
||||
|
@ -732,6 +743,7 @@ def restart_map(release=None):
|
|||
that should be restarted when file changes.
|
||||
'''
|
||||
release = release or os_release('neutron-common')
|
||||
cmp_release = CompareOpenStackReleases(release)
|
||||
plugin = config('plugin')
|
||||
config_files = resolve_config_files(plugin, release)
|
||||
_map = {}
|
||||
|
@ -744,10 +756,11 @@ def restart_map(release=None):
|
|||
svcs.remove('neutron-vpn-agent')
|
||||
if 'neutron-vpn-agent' in svcs and 'neutron-l3-agent' in svcs:
|
||||
svcs.remove('neutron-l3-agent')
|
||||
if (CompareOpenStackReleases(release) >= 'newton' and
|
||||
'neutron-lbaas-agent' in svcs):
|
||||
if cmp_release >= 'newton' and 'neutron-lbaas-agent' in svcs:
|
||||
svcs.remove('neutron-lbaas-agent')
|
||||
svcs.add('neutron-lbaasv2-agent')
|
||||
if cmp_release >= 'train' and 'neutron-lbaasv2-agent' in svcs:
|
||||
svcs.remove('neutron-lbaasv2-agent')
|
||||
if svcs:
|
||||
_map[f] = list(svcs)
|
||||
return _map
|
||||
|
@ -1095,5 +1108,7 @@ def configure_apparmor():
|
|||
if cmp_os_source >= 'newton':
|
||||
profiles.remove(NEUTRON_LBAAS_AA_PROFILE)
|
||||
profiles.append(NEUTRON_LBAASV2_AA_PROFILE)
|
||||
if cmp_os_source >= 'train':
|
||||
profiles.remove(NEUTRON_LBAASV2_AA_PROFILE)
|
||||
for profile in profiles:
|
||||
context.AppArmorContext(profile).setup_aa_profile()
|
||||
|
|
|
@ -185,6 +185,7 @@ class TestNeutronUtils(CharmTestCase):
|
|||
len([p for p in packages if not p.startswith('python-')])
|
||||
)
|
||||
self.assertFalse('python3-neutron-lbaas' in packages)
|
||||
self.assertFalse('neutron-lbaasv2-agent' in packages)
|
||||
|
||||
def test_get_purge_packages_ovs(self):
|
||||
self.config.return_value = 'ovs'
|
||||
|
@ -613,6 +614,46 @@ class TestNeutronUtils(CharmTestCase):
|
|||
}
|
||||
self.assertEqual(neutron_utils.restart_map(), ex_map)
|
||||
|
||||
@patch.object(neutron_utils, 'get_packages')
|
||||
def test_restart_map_ovs_train(self, mock_get_packages):
|
||||
self.patch_object(neutron_utils, 'disable_nova_metadata',
|
||||
return_value=False)
|
||||
self.config.return_value = 'ovs'
|
||||
mock_get_packages.return_value = ['neutron-vpn-agent']
|
||||
self.os_release.return_value = 'train'
|
||||
ex_map = {
|
||||
neutron_utils.NEUTRON_CONF: ['neutron-vpn-agent',
|
||||
'neutron-dhcp-agent',
|
||||
'neutron-metering-agent',
|
||||
'neutron-metadata-agent',
|
||||
'neutron-openvswitch-agent'],
|
||||
neutron_utils.NEUTRON_DNSMASQ_CONF: ['neutron-dhcp-agent'],
|
||||
neutron_utils.NEUTRON_OVS_AGENT_CONF:
|
||||
['neutron-openvswitch-agent'],
|
||||
neutron_utils.NEUTRON_METADATA_AGENT_CONF:
|
||||
['neutron-metadata-agent'],
|
||||
neutron_utils.NEUTRON_VPNAAS_AGENT_CONF: ['neutron-vpn-agent'],
|
||||
neutron_utils.NEUTRON_L3_AGENT_CONF: ['neutron-vpn-agent'],
|
||||
neutron_utils.NEUTRON_DHCP_AGENT_CONF: ['neutron-dhcp-agent'],
|
||||
neutron_utils.NEUTRON_FWAAS_CONF: ['neutron-vpn-agent'],
|
||||
neutron_utils.NEUTRON_METERING_AGENT_CONF:
|
||||
['neutron-metering-agent'],
|
||||
neutron_utils.NOVA_CONF: ['nova-api-metadata'],
|
||||
neutron_utils.EXT_PORT_CONF: ['ext-port'],
|
||||
neutron_utils.PHY_NIC_MTU_CONF: ['os-charm-phy-nic-mtu'],
|
||||
neutron_utils.NEUTRON_DHCP_AA_PROFILE_PATH: ['neutron-dhcp-agent'],
|
||||
neutron_utils.NEUTRON_OVS_AA_PROFILE_PATH:
|
||||
['neutron-openvswitch-agent'],
|
||||
neutron_utils.NEUTRON_L3_AA_PROFILE_PATH: ['neutron-vpn-agent'],
|
||||
neutron_utils.NEUTRON_METADATA_AA_PROFILE_PATH:
|
||||
['neutron-metadata-agent'],
|
||||
neutron_utils.NEUTRON_METERING_AA_PROFILE_PATH:
|
||||
['neutron-metering-agent'],
|
||||
neutron_utils.NOVA_API_METADATA_AA_PROFILE_PATH:
|
||||
['nova-api-metadata'],
|
||||
}
|
||||
self.assertEqual(neutron_utils.restart_map(), ex_map)
|
||||
|
||||
@patch.object(neutron_utils, 'get_packages')
|
||||
def test_restart_map_ovs_post_trusty(self, mock_get_packages):
|
||||
self.patch_object(neutron_utils, 'disable_nova_metadata',
|
||||
|
|
Loading…
Reference in New Issue