Switch provider from ovs to dpdkovs
In order to conform to library changes switch bridge provider from ovs to dpdkovs. Related-Bug: #1638036 Depends-On: I249b15b799da3b649c5843f71d8eabf8b460f510 Change-Id: I8296cfafa7322babd3831724b88aa253bdb13fec
This commit is contained in:
parent
efdd063170
commit
8de9e0c54c
@ -1478,7 +1478,7 @@ class DPDKSerializerMixin90(object):
|
||||
|
||||
@classmethod
|
||||
def configure_private_network_dpdk(cls, node, nm, transformations,
|
||||
nets_by_ifaces):
|
||||
nets_by_ifaces, dpdk_br_provider):
|
||||
"""This method configures transformations for private network.
|
||||
|
||||
It is used for VLAN and VXLAN segmentation types only.
|
||||
@ -1496,7 +1496,7 @@ class DPDKSerializerMixin90(object):
|
||||
|
||||
transformations.append(cls.add_bridge(
|
||||
br_name,
|
||||
provider=consts.NEUTRON_L23_PROVIDERS.ovs,
|
||||
provider=dpdk_br_provider,
|
||||
vendor_specific=vendor_specific))
|
||||
|
||||
for iface in node.nic_interfaces:
|
||||
@ -1595,13 +1595,14 @@ class NeutronNetworkDeploymentSerializer90(
|
||||
|
||||
@classmethod
|
||||
def generate_transformations_by_segmentation_type(
|
||||
cls, node, nm, transformations, prv_base_ep, nets_by_ifaces
|
||||
cls, node, nm, transformations, prv_base_ep, nets_by_ifaces,
|
||||
dpdk_br_provider=consts.NEUTRON_L23_PROVIDERS.ovs
|
||||
):
|
||||
if (objects.Node.dpdk_enabled(node) and
|
||||
objects.Cluster.is_dpdk_supported_for_segmentation(
|
||||
node.cluster)):
|
||||
cls.configure_private_network_dpdk(
|
||||
node, nm, transformations, nets_by_ifaces
|
||||
node, nm, transformations, nets_by_ifaces, dpdk_br_provider
|
||||
)
|
||||
else:
|
||||
(super(NeutronNetworkDeploymentSerializer90, cls)
|
||||
@ -1647,3 +1648,22 @@ class NeutronNetworkTemplateSerializer90(
|
||||
NeutronNetworkTemplateSerializer80
|
||||
):
|
||||
pass
|
||||
|
||||
|
||||
class NeutronNetworkTemplateSerializer110(
|
||||
NeutronNetworkTemplateSerializer90
|
||||
):
|
||||
pass
|
||||
|
||||
|
||||
class NeutronNetworkDeploymentSerializer110(
|
||||
NeutronNetworkDeploymentSerializer90
|
||||
):
|
||||
@classmethod
|
||||
def generate_transformations_by_segmentation_type(
|
||||
cls, node, nm, transformations, prv_base_ep, nets_by_ifaces
|
||||
):
|
||||
(super(NeutronNetworkDeploymentSerializer110, cls)
|
||||
.generate_transformations_by_segmentation_type(
|
||||
node, nm, transformations, prv_base_ep, nets_by_ifaces,
|
||||
consts.NEUTRON_L23_PROVIDERS.dpdkovs))
|
||||
|
@ -845,6 +845,16 @@ class DeploymentLCMSerializer(DeploymentHASerializer90):
|
||||
return serialized_node
|
||||
|
||||
|
||||
class DeploymentLCMSerializer110(DeploymentLCMSerializer):
|
||||
|
||||
@classmethod
|
||||
def get_net_provider_serializer(cls, cluster):
|
||||
if cluster.network_config.configuration_template:
|
||||
return neutron_serializers.NeutronNetworkTemplateSerializer110
|
||||
else:
|
||||
return neutron_serializers.NeutronNetworkDeploymentSerializer110
|
||||
|
||||
|
||||
def get_serializer_for_cluster(cluster):
|
||||
"""Returns a serializer depends on a given `cluster`.
|
||||
|
||||
@ -886,7 +896,7 @@ def get_serializer_for_cluster(cluster):
|
||||
return serializers[env_mode]
|
||||
|
||||
# return latest serializer by default
|
||||
latest_version = max(serializers_map, key=lambda v: StrictVersion(v))
|
||||
latest_version = max(serializers_map.keys(), key=StrictVersion)
|
||||
|
||||
return serializers_map[latest_version][env_mode]
|
||||
|
||||
@ -917,8 +927,19 @@ def serialize(orchestrator_graph, cluster, nodes,
|
||||
|
||||
def serialize_for_lcm(cluster, nodes,
|
||||
ignore_customized=False, skip_extensions=False):
|
||||
serializers_map = {
|
||||
'default': DeploymentLCMSerializer,
|
||||
'11.0': DeploymentLCMSerializer110,
|
||||
}
|
||||
|
||||
serializer_lcm = serializers_map['default']
|
||||
for version, serializer in six.iteritems(serializers_map):
|
||||
if cluster.release.environment_version.startswith(version):
|
||||
serializer_lcm = serializer
|
||||
break
|
||||
|
||||
return _invoke_serializer(
|
||||
DeploymentLCMSerializer(), cluster, nodes,
|
||||
serializer_lcm(), cluster, nodes,
|
||||
ignore_customized, skip_extensions
|
||||
)
|
||||
|
||||
|
@ -0,0 +1,66 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Copyright 2016 Mirantis, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from nailgun import consts
|
||||
from nailgun.orchestrator import deployment_serializers
|
||||
from nailgun.test.integration import test_orchestrator_serializer_90
|
||||
|
||||
|
||||
class TestSerializer110Mixin(object):
|
||||
env_version = 'ocata-11.0'
|
||||
task_deploy = True
|
||||
dpdk_bridge_provider = consts.NEUTRON_L23_PROVIDERS.dpdkovs
|
||||
|
||||
@classmethod
|
||||
def create_serializer(cls, cluster):
|
||||
return deployment_serializers.DeploymentLCMSerializer110()
|
||||
|
||||
@classmethod
|
||||
def _get_serializer(cluster):
|
||||
return deployment_serializers.DeploymentLCMSerializer110()
|
||||
|
||||
@staticmethod
|
||||
def _get_plugins_names(plugins):
|
||||
"""Plugins names for LCM serializers
|
||||
|
||||
Single out <name> since plugin data may contain
|
||||
<scripts>, <repositories>, <whatever> as well.
|
||||
|
||||
:param nodes: array of plugins data
|
||||
:returns: singled out names of plugins
|
||||
"""
|
||||
return [plugin['name'] for plugin in plugins]
|
||||
|
||||
|
||||
class TestDeploymentAttributesSerialization110(
|
||||
TestSerializer110Mixin,
|
||||
test_orchestrator_serializer_90.TestDeploymentAttributesSerialization90
|
||||
):
|
||||
pass
|
||||
|
||||
|
||||
class TestDeploymentLCMSerialization110(
|
||||
TestSerializer110Mixin,
|
||||
test_orchestrator_serializer_90.TestDeploymentLCMSerialization90
|
||||
):
|
||||
pass
|
||||
|
||||
|
||||
class TestSerializeInterfaceDriversData110(
|
||||
TestSerializer110Mixin,
|
||||
test_orchestrator_serializer_90.TestSerializeInterfaceDriversData90
|
||||
):
|
||||
pass
|
Loading…
Reference in New Issue
Block a user