Merge "Add "connectivity" parameter in vif_details"
This commit is contained in:
commit
c53dee3e8b
@ -33,10 +33,13 @@ class LinuxbridgeMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
|
||||
|
||||
def __init__(self):
|
||||
sg_enabled = securitygroups_rpc.is_firewall_enabled()
|
||||
vif_details = {portbindings.CAP_PORT_FILTER: sg_enabled,
|
||||
portbindings.VIF_DETAILS_CONNECTIVITY:
|
||||
portbindings.CONNECTIVITY_L2}
|
||||
super(LinuxbridgeMechanismDriver, self).__init__(
|
||||
constants.AGENT_TYPE_LINUXBRIDGE,
|
||||
portbindings.VIF_TYPE_BRIDGE,
|
||||
{portbindings.CAP_PORT_FILTER: sg_enabled})
|
||||
vif_details)
|
||||
lb_qos_driver.register()
|
||||
|
||||
def get_allowed_network_types(self, agent):
|
||||
|
@ -38,10 +38,13 @@ class MacvtapMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
|
||||
"""
|
||||
|
||||
def __init__(self):
|
||||
vif_details = {portbindings.CAP_PORT_FILTER: False,
|
||||
portbindings.VIF_DETAILS_CONNECTIVITY:
|
||||
portbindings.CONNECTIVITY_L2}
|
||||
super(MacvtapMechanismDriver, self).__init__(
|
||||
constants.AGENT_TYPE_MACVTAP,
|
||||
portbindings.VIF_TYPE_MACVTAP,
|
||||
{portbindings.CAP_PORT_FILTER: False})
|
||||
vif_details)
|
||||
|
||||
def get_allowed_network_types(self, agent):
|
||||
return [constants.TYPE_FLAT, constants.TYPE_VLAN]
|
||||
|
@ -265,7 +265,9 @@ class SimpleAgentMechanismDriverBase(AgentMechanismDriverBase):
|
||||
super(SimpleAgentMechanismDriverBase, self).__init__(
|
||||
agent_type, supported_vnic_types)
|
||||
self.vif_type = vif_type
|
||||
self.vif_details = vif_details
|
||||
self.vif_details = {portbindings.VIF_DETAILS_CONNECTIVITY:
|
||||
portbindings.CONNECTIVITY_LEGACY}
|
||||
self.vif_details.update(vif_details)
|
||||
|
||||
def try_to_bind_segment_for_agent(self, context, segment, agent):
|
||||
if self.check_segment_for_agent(segment, agent):
|
||||
|
@ -55,7 +55,9 @@ class SriovNicSwitchMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
|
||||
|
||||
def __init__(self,
|
||||
agent_type=constants.AGENT_TYPE_NIC_SWITCH,
|
||||
vif_details={portbindings.CAP_PORT_FILTER: False},
|
||||
vif_details={portbindings.CAP_PORT_FILTER: False,
|
||||
portbindings.VIF_DETAILS_CONNECTIVITY:
|
||||
portbindings.CONNECTIVITY_L2},
|
||||
supported_vnic_types=[portbindings.VNIC_DIRECT,
|
||||
portbindings.VNIC_MACVTAP,
|
||||
portbindings.VNIC_DIRECT_PHYSICAL]):
|
||||
|
@ -62,7 +62,9 @@ class OpenvswitchMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
|
||||
IPTABLES_FW_DRIVER_FULL, 'iptables_hybrid')
|
||||
) and sg_enabled
|
||||
vif_details = {portbindings.CAP_PORT_FILTER: sg_enabled,
|
||||
portbindings.OVS_HYBRID_PLUG: hybrid_plug_required}
|
||||
portbindings.OVS_HYBRID_PLUG: hybrid_plug_required,
|
||||
portbindings.VIF_DETAILS_CONNECTIVITY:
|
||||
portbindings.CONNECTIVITY_L2}
|
||||
# NOTE(moshele): Bind DIRECT (SR-IOV) port allows
|
||||
# to offload the OVS flows using tc to the SR-IOV NIC.
|
||||
# We are using OVS mechanism driver because the openvswitch (>=2.8.0)
|
||||
|
@ -34,7 +34,9 @@ class OpenvswitchMechanismBaseTestCase(base.AgentMechanismBaseTestCase):
|
||||
VIF_DETAILS = {'bridge_name': 'br-int',
|
||||
portbindings.OVS_DATAPATH_TYPE: 'system',
|
||||
portbindings.CAP_PORT_FILTER: True,
|
||||
portbindings.OVS_HYBRID_PLUG: True}
|
||||
portbindings.OVS_HYBRID_PLUG: True,
|
||||
portbindings.VIF_DETAILS_CONNECTIVITY:
|
||||
portbindings.CONNECTIVITY_L2}
|
||||
AGENT_TYPE = constants.AGENT_TYPE_OVS
|
||||
|
||||
GOOD_MAPPINGS = {'fake_physical_network': 'fake_bridge'}
|
||||
@ -112,7 +114,9 @@ class OpenvswitchMechanismSGDisabledBaseTestCase(
|
||||
VIF_DETAILS = {'bridge_name': 'br-int',
|
||||
portbindings.OVS_DATAPATH_TYPE: 'system',
|
||||
portbindings.CAP_PORT_FILTER: False,
|
||||
portbindings.OVS_HYBRID_PLUG: False}
|
||||
portbindings.OVS_HYBRID_PLUG: False,
|
||||
portbindings.VIF_DETAILS_CONNECTIVITY:
|
||||
portbindings.CONNECTIVITY_L2}
|
||||
|
||||
def setUp(self):
|
||||
cfg.CONF.set_override('enable_security_group',
|
||||
@ -218,11 +222,6 @@ class OpenvswitchMechanismSGDisabledLocalTestCase(
|
||||
class OpenvswitchMechanismFirewallUndefinedTestCase(
|
||||
OpenvswitchMechanismBaseTestCase, base.AgentMechanismLocalTestCase):
|
||||
|
||||
VIF_DETAILS = {'bridge_name': 'br-int',
|
||||
portbindings.OVS_DATAPATH_TYPE: 'system',
|
||||
portbindings.CAP_PORT_FILTER: True,
|
||||
portbindings.OVS_HYBRID_PLUG: True}
|
||||
|
||||
def setUp(self):
|
||||
# this simple test case just ensures backward compatibility where
|
||||
# the server has no firewall driver configured, which should result
|
||||
|
Loading…
Reference in New Issue
Block a user