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 2ece1002d2)
This commit is contained in:
Lucian Petrut 2020-10-14 14:48:49 +03:00
parent a3413f4111
commit 77375464d8
1 changed files with 2 additions and 4 deletions

View File

@ -50,7 +50,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
@ -1945,9 +1944,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)