From 96ba49807c38165bfc838aab569b5ec1804bd08b Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Fri, 23 Apr 2021 16:40:16 -0400 Subject: [PATCH] Fix regression of disable-mlockall This restores OVS_DEFAULT to the BASE_RESOURCE_MAP. There were some changes in commit ad7f870c that moved OVS_DEFAULT out of the BASE_RESOURCE_MAP, which resulted in no more rendering of /etc/default/openvswitch-switch for non-DPDK deployments. Closes-Bug: #1925962 Change-Id: I8bc6e0c20e5702db5a44fda531b6a59ada5bee1e --- hooks/neutron_ovs_utils.py | 4 ++++ unit_tests/test_neutron_ovs_utils.py | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hooks/neutron_ovs_utils.py b/hooks/neutron_ovs_utils.py index 3e2dcbd0..cc027884 100644 --- a/hooks/neutron_ovs_utils.py +++ b/hooks/neutron_ovs_utils.py @@ -185,6 +185,10 @@ BASE_RESOURCE_MAP = OrderedDict([ 'services': ['neutron-openvswitch-agent'], 'contexts': [neutron_ovs_context.OVSPluginContext()], }), + (OVS_DEFAULT, { + 'services': ['openvswitch-switch'], + 'contexts': [neutron_ovs_context.OVSPluginContext()], + }), (PHY_NIC_MTU_CONF, { 'services': ['os-charm-phy-nic-mtu'], 'contexts': [context.PhyNICMTUContext()], diff --git a/unit_tests/test_neutron_ovs_utils.py b/unit_tests/test_neutron_ovs_utils.py index d621dd19..d221fd7e 100644 --- a/unit_tests/test_neutron_ovs_utils.py +++ b/unit_tests/test_neutron_ovs_utils.py @@ -428,7 +428,7 @@ class TestNeutronOVSUtils(CharmTestCase): _regconfs = nutils.register_configs() confs = ['/etc/neutron/neutron.conf', '/etc/neutron/plugins/ml2/ml2_conf.ini', - # '/etc/default/openvswitch-switch', + '/etc/default/openvswitch-switch', '/etc/init/os-charm-phy-nic-mtu.conf'] self.assertEqual(_regconfs.configs, confs) @@ -450,7 +450,7 @@ class TestNeutronOVSUtils(CharmTestCase): _regconfs = nutils.register_configs() confs = ['/etc/neutron/neutron.conf', '/etc/neutron/plugins/ml2/openvswitch_agent.ini', - # '/etc/default/openvswitch-switch', + '/etc/default/openvswitch-switch', '/etc/init/os-charm-phy-nic-mtu.conf'] self.assertEqual(_regconfs.configs, confs) @@ -584,7 +584,7 @@ class TestNeutronOVSUtils(CharmTestCase): for item in _restart_map: self.assertTrue(item in _restart_map) self.assertTrue(expect[item] == _restart_map[item]) - self.assertEqual(len(_restart_map.keys()), 2) + self.assertEqual(len(_restart_map.keys()), 3) @patch('charmhelpers.contrib.openstack.context.list_nics', return_value=['eth0'])