本文整理汇总了Python中neutron.agent.securitygroups_rpc.is_firewall_enabled函数的典型用法代码示例。如果您正苦于以下问题:Python is_firewall_enabled函数的具体用法?Python is_firewall_enabled怎么用?Python is_firewall_enabled使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_firewall_enabled函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _extend_port_dict_binding
def _extend_port_dict_binding(self, context, port):
cfg_vif_type = cfg.CONF.NOVA.vif_type.lower()
if not cfg_vif_type in (portbindings.VIF_TYPE_OVS,
portbindings.VIF_TYPE_IVS):
LOG.warning(_("Unrecognized vif_type in configuration "
"[%s]. Defaulting to ovs."),
cfg_vif_type)
cfg_vif_type = portbindings.VIF_TYPE_OVS
# In ML2, the host_id is already populated
if portbindings.HOST_ID in port:
hostid = port[portbindings.HOST_ID]
elif 'id' in port:
hostid = porttracker_db.get_port_hostid(context, port['id'])
else:
hostid = None
if hostid:
port[portbindings.HOST_ID] = hostid
override = self._check_hostvif_override(hostid)
if override:
cfg_vif_type = override
port[portbindings.VIF_TYPE] = cfg_vif_type
sg_enabled = sg_rpc.is_firewall_enabled()
port[portbindings.VIF_DETAILS] = {
# TODO(rkukura): Replace with new VIF security details
portbindings.CAP_PORT_FILTER:
'security-group' in self.supported_extension_aliases,
portbindings.OVS_HYBRID_PLUG: sg_enabled
}
return port
示例2: __init__
def __init__(self, context, plugin_rpc):
self.context = context
self.plugin_rpc = plugin_rpc
if sg_rpc.is_firewall_enabled():
self.init_firewall()
self._setup_rpc()
示例3: __init__
def __init__(self):
sg_enabled = securitygroups_rpc.is_firewall_enabled()
super(LinuxbridgeMechanismDriver, self).__init__(
constants.AGENT_TYPE_LINUXBRIDGE,
portbindings.VIF_TYPE_BRIDGE,
{portbindings.CAP_PORT_FILTER: sg_enabled})
lb_qos_driver.register()
示例4: _get_base_binding_dict
def _get_base_binding_dict(self):
sg_enabled = sg_rpc.is_firewall_enabled()
vif_details = {portbindings.CAP_PORT_FILTER: sg_enabled,
portbindings.OVS_HYBRID_PLUG: sg_enabled}
binding = {portbindings.VIF_TYPE: portbindings.VIF_TYPE_OVS,
portbindings.VIF_DETAILS: vif_details}
return binding
示例5: __init__
def __init__(self, context, plugin_rpc):
# Note: as rootwrap is not supported on HyperV, root_helper is
# passed in as None.
super(HyperVSecurityAgent, self).__init__(context, plugin_rpc,
root_helper=None)
if sg_rpc.is_firewall_enabled():
self._setup_rpc()
示例6: __init__
def __init__(self):
sg_enabled = securitygroups_rpc.is_firewall_enabled()
hybrid_plug_required = (not cfg.CONF.SECURITYGROUP.firewall_driver or
cfg.CONF.SECURITYGROUP.firewall_driver in (
IPTABLES_FW_DRIVER_FULL, 'iptables_hybrid')) and sg_enabled
vif_details = {portbindings.CAP_PORT_FILTER: sg_enabled,
portbindings.OVS_HYBRID_PLUG: hybrid_plug_required}
# 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)
# support hardware offload via tc and that allow us to manage the VF by
# OpenFlow control plane using representor net-device.
super(OpenvswitchMechanismDriver, self).__init__(
constants.AGENT_TYPE_OVS,
portbindings.VIF_TYPE_OVS,
vif_details)
# TODO(lajoskatona): move this blacklisting to
# SimpleAgentMechanismDriverBase. By that e blacklisting and validation
# of the vnic_types would be available for all mechanism drivers.
self.supported_vnic_types = self.blacklist_supported_vnic_types(
vnic_types=[portbindings.VNIC_NORMAL, portbindings.VNIC_DIRECT],
blacklist=cfg.CONF.OVS_DRIVER.vnic_type_blacklist
)
LOG.info("%s's supported_vnic_types: %s",
self.agent_type, self.supported_vnic_types)
ovs_qos_driver.register()
log_driver.register()
示例7: __init__
def __init__(self):
sg_enabled = securitygroups_rpc.is_firewall_enabled()
vif_details = {portbindings.CAP_PORT_FILTER: sg_enabled,
portbindings.OVS_HYBRID_PLUG: sg_enabled}
super(OpenvswitchMechanismDriver, self).__init__(
constants.AGENT_TYPE_OVS,
portbindings.VIF_TYPE_OVS,
vif_details)
示例8: __init__
def __init__(self, context, plugin_rpc):
super(HyperVSecurityAgent, self).__init__()
self.context = context
self.plugin_rpc = plugin_rpc
if sg_rpc.is_firewall_enabled():
self.init_firewall()
self._setup_rpc()
示例9: __init__
def __init__(self):
sg_enabled = securitygroups_rpc.is_firewall_enabled()
hybrid_plug_required = (
cfg.CONF.SECURITYGROUP.firewall_driver in (IPTABLES_FW_DRIVER_FULL, "iptables_hybrid")
) and sg_enabled
vif_details = {portbindings.CAP_PORT_FILTER: sg_enabled, portbindings.OVS_HYBRID_PLUG: hybrid_plug_required}
super(OpenvswitchMechanismDriver, self).__init__(
constants.AGENT_TYPE_OVS, portbindings.VIF_TYPE_OVS, vif_details
)
示例10: __init__
def __init__(self):
sg_enabled = securitygroups_rpc.is_firewall_enabled()
vif_details = {portbindings.CAP_PORT_FILTER: sg_enabled, portbindings.OVS_HYBRID_PLUG: sg_enabled}
super(FortinetMechanismDriver, self).__init__(constants.AGENT_TYPE_OVS, portbindings.VIF_TYPE_OVS, vif_details)
self._driver = None
self._fortigate = None
self.task_manager = tasks.TaskManager()
self.task_manager.start()
示例11: __init__
def __init__(self):
sg_enabled = securitygroups_rpc.is_firewall_enabled()
vif_details = {portbindings.CAP_PORT_FILTER: sg_enabled,
portbindings.OVS_HYBRID_PLUG: sg_enabled}
super(FakeAgentMechanismDriver, self).__init__(
# NOTE(yamamoto): l2pop driver has a hardcoded list of
# supported agent types.
constants.AGENT_TYPE_OFA,
portbindings.VIF_TYPE_OVS,
vif_details)
示例12: __init__
def __init__(self):
self.vif_type = dvs_const.DVS
sg_enabled = securitygroups_rpc.is_firewall_enabled()
self.vif_details = {portbindings.CAP_PORT_FILTER: sg_enabled,
portbindings.OVS_HYBRID_PLUG: sg_enabled}
self.context = context.get_admin_context_without_session()
self.dvs_notifier = dvs_agent_rpc_api.DVSClientAPI(self.context)
LOG.info(_LI('DVS_notifier'))
super(VMwareDVSMechanismDriver, self).__init__(
dvs_const.AGENT_TYPE_DVS,
self.vif_type,
self.vif_details)
示例13: delete_port_postcommit
def delete_port_postcommit(self, current, original, segment):
try:
dvs = self._lookup_dvs_for_context(segment)
except exceptions.NoDVSForPhysicalNetwork:
raise exceptions.InvalidSystemState(
details=_("Port %(port_id)s belong to VMWare VM, but there is " "no mapping from network to DVS.")
% {"port_id": current["id"]}
)
else:
if sg_rpc.is_firewall_enabled():
key = current.get("binding:vif_details", {}).get("dvs_port_key")
if key:
dvs.remove_block(key)
else:
dvs.release_port(current)
示例14: __init__
def __init__(self):
sg_enabled = securitygroups_rpc.is_firewall_enabled()
hybrid_plug_required = (not cfg.CONF.SECURITYGROUP.firewall_driver or
cfg.CONF.SECURITYGROUP.firewall_driver in (
IPTABLES_FW_DRIVER_FULL, 'iptables_hybrid')) and sg_enabled
vif_details = {portbindings.CAP_PORT_FILTER: sg_enabled,
portbindings.OVS_HYBRID_PLUG: hybrid_plug_required}
# 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)
# support hardware offload via tc and that allow us to manage the VF by
# OpenFlow control plane using representor net-device.
super(OpenvswitchMechanismDriver, self).__init__(
constants.AGENT_TYPE_OVS,
portbindings.VIF_TYPE_OVS,
vif_details, supported_vnic_types=[portbindings.VNIC_NORMAL,
portbindings.VNIC_DIRECT])
ovs_qos_driver.register()
log_driver.register()
示例15: __init__
def __init__(self, context, plugin_rpc):
super(VBoxSecurityAgent, self).__init__(context, plugin_rpc)
if sg_rpc.is_firewall_enabled():
self._setup_rpc()