stein: switch to FWaaS v2

FWaaS v1 has been removed as of the latest Stein snapshots. Switch
to configuration of v2 service provider.

This commit also switches >= rocky to use the lbaasv2 entry point
rather than the fully qualified class name for the lbaas service
provider.

Change-Id: Id0fd808a33dff25d48610bcf97d12c512a21fc40
This commit is contained in:
James Page 2019-03-20 05:34:02 +00:00
parent e6f66cd15b
commit 25ec688145
3 changed files with 29 additions and 7 deletions

View File

@ -567,19 +567,23 @@ class NeutronCCContext(context.NeutronContext):
'rocky': ['router', 'firewall', 'metering', 'segments',
('neutron_dynamic_routing.'
'services.bgp.bgp_plugin.BgpPlugin')],
'stein': ['router', 'firewall_v2', 'metering', 'segments',
('neutron_dynamic_routing.'
'services.bgp.bgp_plugin.BgpPlugin')],
}
if cmp_release >= 'rocky':
if ctxt.get('load_balancer_name', None):
# TODO(fnordahl): Remove when ``neutron_lbaas`` is retired
service_plugins['rocky'].append('lbaasv2-proxy')
service_plugins[release].append('lbaasv2-proxy')
else:
# TODO(fnordahl): Remove fall-back in next charm release
service_plugins['rocky'].append(
'neutron_lbaas.services.loadbalancer.plugin.'
'LoadBalancerPluginv2')
service_plugins[release].append('lbaasv2')
if cmp_release >= 'stein':
ctxt['firewall_v2'] = True
ctxt['service_plugins'] = service_plugins.get(
release, service_plugins['rocky'])
release, service_plugins['stein'])
if is_nsg_logging_enabled():
ctxt['service_plugins'].append('log')

View File

@ -133,4 +133,9 @@ base_url = {{ load_balancer_base_url }}
service_provider = LOADBALANCERV2:Haproxy:neutron_lbaas.drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
{% endif %}
{% if firewall_v2 -%}
[service_providers]
service_provider = FIREWALL_V2:fwaas_db:neutron_fwaas.services.firewall.service_drivers.agents.agents.FirewallAgentDriver:default
{% endif %}
{% include "section-oslo-middleware" %}

View File

@ -953,9 +953,22 @@ class NeutronCCContextTest(CharmTestCase):
service_plugins = (
'router,firewall,metering,segments,'
'neutron_dynamic_routing.services.bgp.bgp_plugin.BgpPlugin,'
'neutron_lbaas.services.loadbalancer.plugin.LoadBalancerPluginv2')
self.assertEqual(context.NeutronCCContext()()['service_plugins'],
'lbaasv2')
ncc_context = context.NeutronCCContext()()
self.assertEqual(ncc_context['service_plugins'],
service_plugins)
# stein
self.os_release.return_value = 'stein'
service_plugins = (
'router,firewall_v2,metering,segments,'
'neutron_dynamic_routing.services.bgp.bgp_plugin.BgpPlugin,'
'lbaasv2')
ncc_context = context.NeutronCCContext()()
self.assertEqual(ncc_context['service_plugins'],
service_plugins)
self.assertTrue(ncc_context['firewall_v2'])
# rocky and related to charm through neutron-load-balancer interface
self.os_release.return_value = 'rocky'
service_plugins = (