From dea24403a71bb6a87b00a7fa78b25ef16f7fe889 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Wed, 14 Oct 2020 14:48:49 +0300 Subject: [PATCH] Fix ovs agent, avoiding import error A recent change[1] added a "iptables_firewall" import to the ovs agent, which isn't importable on Windows[2]. This prevents the neutron ovs agent from starting on Windows. This patch updates the security group driver check, avoiding the unsupported import. [1] Iecf9cffaf02616342f1727ad7db85545d8adbec2 [2] http://paste.openstack.org/raw/799030/ Closes-Bug: #1899775 Change-Id: I8877dbf4b0b9cd185ae0b8715b7e8e6d87e0afcc (cherry picked from commit 2ece1002d258e3388607e7df7677a0afae98d2cd) --- .../ml2/drivers/openvswitch/agent/ovs_neutron_agent.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py b/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py index 481dfe22fa9..0895acff021 100644 --- a/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py +++ b/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_neutron_agent.py @@ -56,7 +56,6 @@ from neutron.agent.common import polling from neutron.agent.common import utils from neutron.agent import firewall as agent_firewall from neutron.agent.l2 import l2_agent_extensions_manager as ext_manager -from neutron.agent.linux import iptables_firewall from neutron.agent.linux import xenapi_root_helper from neutron.agent import rpc as agent_rpc from neutron.agent import securitygroups_rpc as agent_sg_rpc @@ -2145,9 +2144,8 @@ class OVSNeutronAgent(l2population_rpc.L2populationRpcCallBackTunnelMixin, def direct_for_non_openflow_firewall(self): return ((isinstance(self.sg_agent.firewall, agent_firewall.NoopFirewallDriver) or - isinstance( - self.sg_agent.firewall, - iptables_firewall.OVSHybridIptablesFirewallDriver) or + getattr(self.sg_agent.firewall, + 'OVS_HYBRID_PLUG_REQUIRED', False) or not agent_sg_rpc.is_firewall_enabled()) and self.conf.AGENT.explicitly_egress_direct)