Remove init scripts used to set MTU on xenial+

When deploying on xenial or higher, no longer render the upstart scripts for
setting NIC MTU.

The scripts are being removed rather than converted to systemd on xenial
because MAAS1.9 now has the functionality needed to set the mtu on all ports,
even if they do not have ip address configuration. MAAS1.9 will also ensure
that they are upped during boot

Also needed a driveby fix of missing charms to satisfy relations in amulet
tests

Change-Id: Ib420b7c0135b61c115e69a09859353e7cd693539
Partial-Bug: 1566786
This commit is contained in:
Liam Young
2016-04-06 11:32:21 +00:00
parent 7f5acef378
commit 8a459218dc
3 changed files with 63 additions and 3 deletions

View File

@@ -501,6 +501,7 @@ def resolve_config_files(plugin, release):
and associated services
'''
config_files = deepcopy(CONFIG_FILES)
drop_config = []
if plugin == OVS:
# NOTE: deal with switch to ML2 plugin for >= icehouse
drop_config = [NEUTRON_OVS_AGENT_CONF]
@@ -508,9 +509,13 @@ def resolve_config_files(plugin, release):
# ml2 -> ovs_agent
drop_config = [NEUTRON_ML2_PLUGIN_CONF]
for _config in drop_config:
if _config in config_files[plugin]:
config_files[plugin].pop(_config)
# Use MAAS1.9 for MTU and external port config on xenial and above
if lsb_release()['DISTRIB_CODENAME'] >= 'xenial':
drop_config.extend([EXT_PORT_CONF, PHY_NIC_MTU_CONF])
for _config in drop_config:
if _config in config_files[plugin]:
config_files[plugin].pop(_config)
if is_relation_made('amqp-nova'):
amqp_nova_ctxt = context.AMQPContext(

View File

@@ -52,6 +52,7 @@ class NeutronGatewayBasicDeployment(OpenStackAmuletDeployment):
{'name': 'glance'}, # satisfy workload status
{'name': 'nova-cloud-controller'},
{'name': 'nova-compute'}, # satisfy workload stat
{'name': 'neutron-openvswitch'},
{'name': 'neutron-api'}]
super(NeutronGatewayBasicDeployment, self)._add_services(
@@ -78,6 +79,9 @@ class NeutronGatewayBasicDeployment(OpenStackAmuletDeployment):
'nova-cloud-controller:cloud-compute': 'nova-compute:'
'cloud-compute',
'nova-compute:amqp': 'rabbitmq-server:amqp',
'nova-compute:neutron-plugin': 'neutron-openvswitch:'
'neutron-plugin',
'rabbitmq-server:amqp': 'neutron-openvswitch:amqp',
'nova-compute:image-service': 'glance:image-service',
'nova-cloud-controller:image-service': 'glance:image-service',
}
@@ -213,6 +217,9 @@ class NeutronGatewayBasicDeployment(OpenStackAmuletDeployment):
self.neutron_gateway_sentry: neutron_services
}
if self._get_openstack_release() >= self.trusty_liberty:
commands[self.keystone_sentry] = ['apache2']
ret = u.validate_services_by_name(commands)
if ret:
amulet.raise_status(amulet.FAIL, msg=ret)

View File

@@ -489,6 +489,54 @@ class TestNeutronUtils(CharmTestCase):
self.assertFalse(_remove.called)
self.assertTrue(self.log.called)
def test_resolve_config_files_ovs_liberty(self):
self._set_distrib_codename('trusty')
self.is_relation_made = False
actual_map = neutron_utils.resolve_config_files(neutron_utils.OVS,
'liberty')
actual_configs = actual_map[neutron_utils.OVS].keys()
INC_CONFIG = [neutron_utils.NEUTRON_ML2_PLUGIN_CONF]
EXC_CONFIG = [neutron_utils.NEUTRON_OVS_AGENT_CONF]
for config in INC_CONFIG:
self.assertTrue(config in actual_configs)
for config in EXC_CONFIG:
self.assertTrue(config not in actual_configs)
def test_resolve_config_files_ovs_mitaka(self):
self._set_distrib_codename('trusty')
self.is_relation_made = False
actual_map = neutron_utils.resolve_config_files(neutron_utils.OVS,
'mitaka')
actual_configs = actual_map[neutron_utils.OVS].keys()
INC_CONFIG = [neutron_utils.NEUTRON_OVS_AGENT_CONF]
EXC_CONFIG = [neutron_utils.NEUTRON_ML2_PLUGIN_CONF]
for config in INC_CONFIG:
self.assertTrue(config in actual_configs)
for config in EXC_CONFIG:
self.assertTrue(config not in actual_configs)
def test_resolve_config_files_ovs_trusty(self):
self._set_distrib_codename('trusty')
self.is_relation_made = False
actual_map = neutron_utils.resolve_config_files(neutron_utils.OVS,
'mitaka')
actual_configs = actual_map[neutron_utils.OVS].keys()
INC_CONFIG = [neutron_utils.EXT_PORT_CONF,
neutron_utils.PHY_NIC_MTU_CONF]
for config in INC_CONFIG:
self.assertTrue(config in actual_configs)
def test_resolve_config_files_ovs_xenial(self):
self._set_distrib_codename('xenial')
self.is_relation_made = False
actual_map = neutron_utils.resolve_config_files(neutron_utils.OVS,
'mitaka')
actual_configs = actual_map[neutron_utils.OVS].keys()
EXC_CONFIG = [neutron_utils.EXT_PORT_CONF,
neutron_utils.PHY_NIC_MTU_CONF]
for config in EXC_CONFIG:
self.assertTrue(config not in actual_configs)
network_context = {
'service_username': 'foo',