]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Monkey patch threading module as early as possible
authorIhar Hrachyshka <ihrachys@redhat.com>
Fri, 30 May 2014 13:53:25 +0000 (15:53 +0200)
committerIhar Hrachyshka <ihrachys@redhat.com>
Mon, 9 Jun 2014 14:42:47 +0000 (16:42 +0200)
In oslo.messaging, local thread store is used to pass RPC request
context [1]. If we try to import oslo.messaging before monkey patching
threading library, it attempts to access unpatched storage and fails
with AttributeError.

[1]: oslo/messaging/localcontext.py#L26

blueprint oslo-messaging

Change-Id: Ied7302fcb1d3e14428540e39e3db704550027890

27 files changed:
neutron/agent/dhcp_agent.py
neutron/agent/l3_agent.py
neutron/agent/metadata/agent.py
neutron/agent/metadata/namespace_proxy.py
neutron/agent/netns_cleanup_util.py
neutron/plugins/bigswitch/agent/restproxy_agent.py
neutron/plugins/hyperv/agent/hyperv_neutron_agent.py
neutron/plugins/ibm/agent/sdnve_neutron_agent.py
neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
neutron/plugins/mlnx/agent/eswitch_neutron_agent.py
neutron/plugins/nec/agent/nec_neutron_agent.py
neutron/plugins/oneconvergence/agent/nvsd_neutron_agent.py
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
neutron/plugins/ryu/agent/ryu_neutron_agent.py
neutron/plugins/vmware/api_client/eventlet_client.py
neutron/server/__init__.py
neutron/services/firewall/agents/varmour/varmour_router.py
neutron/services/loadbalancer/agent/agent.py
neutron/services/loadbalancer/drivers/radware/driver.py
neutron/services/metering/agents/metering_agent.py
neutron/tests/unit/hyperv/test_hyperv_neutron_agent.py
neutron/tests/unit/nec/test_nec_agent.py
neutron/tests/unit/oneconvergence/test_nvsd_agent.py
neutron/tests/unit/services/loadbalancer/agent/test_agent.py
neutron/tests/unit/test_metadata_agent.py
neutron/tests/unit/test_metadata_namespace_proxy.py
neutron/wsgi.py

index bfdbca371b10c9ce0bbe6cb3a58d560f0a3e89be..4b62e0dd85d5d625301248dae3242fd2008291eb 100644 (file)
@@ -18,6 +18,8 @@
 import os
 
 import eventlet
+eventlet.monkey_patch()
+
 import netaddr
 from oslo.config import cfg
 
@@ -607,7 +609,6 @@ def register_options():
 
 
 def main():
-    eventlet.monkey_patch()
     register_options()
     cfg.CONF(project='neutron')
     config.setup_logging(cfg.CONF)
index 778b947cce9fc8bfc99f373c9a89600e4e7ba2e5..7b3df470ed86ce3947ce80e653987e934c4e6407 100644 (file)
@@ -14,6 +14,8 @@
 #
 
 import eventlet
+eventlet.monkey_patch()
+
 import netaddr
 from oslo.config import cfg
 
@@ -967,7 +969,6 @@ class L3NATAgentWithStateReport(L3NATAgent):
 
 
 def main(manager='neutron.agent.l3_agent.L3NATAgentWithStateReport'):
-    eventlet.monkey_patch()
     conf = cfg.CONF
     conf.register_opts(L3NATAgent.OPTS)
     config.register_interface_driver_opts_helper(conf)
index 83aad7c3feb6eaef528297d73396e325cbab4aa3..92b5fe08b22d72acbac7f18a9c431ff68cc80c0c 100644 (file)
@@ -22,6 +22,8 @@ import os
 import socket
 
 import eventlet
+eventlet.monkey_patch()
+
 import httplib2
 from neutronclient.v2_0 import client
 from oslo.config import cfg
@@ -377,7 +379,6 @@ class UnixDomainMetadataProxy(object):
 
 
 def main():
-    eventlet.monkey_patch()
     cfg.CONF.register_opts(UnixDomainMetadataProxy.OPTS)
     cfg.CONF.register_opts(MetadataProxyHandler.OPTS)
     cache.register_oslo_configs(cfg.CONF)
index 0f32328074b64ab9ffe4b6970daa7bd5faa241d4..e330b22cadb8580ac8604921b582d8e6cddbabd2 100644 (file)
@@ -20,6 +20,8 @@ import httplib
 import socket
 
 import eventlet
+eventlet.monkey_patch()
+
 import httplib2
 from oslo.config import cfg
 import six.moves.urllib.parse as urlparse
@@ -144,7 +146,6 @@ class ProxyDaemon(daemon.Daemon):
 
 
 def main():
-    eventlet.monkey_patch()
     opts = [
         cfg.StrOpt('network_id',
                    help=_('Network that will have instance metadata '
index f43efd38493f6e696efda5f60bbf9b090cb0e782..c7e5915b32d033a1882f233b1bf018f91c5d3102 100644 (file)
@@ -18,6 +18,8 @@
 import re
 
 import eventlet
+eventlet.monkey_patch()
+
 from oslo.config import cfg
 
 from neutron.agent.common import config as agent_config
@@ -157,8 +159,6 @@ def main():
     installation as it will blindly purge namespaces and their devices. This
     option also kills any lingering DHCP instances.
     """
-    eventlet.monkey_patch()
-
     conf = setup_conf()
     conf()
     config.setup_logging(conf)
index 91d314055d7cd6a0fe92eaa54a8d74d2240330e7..1d42c6df8600ef44a062c24858493d74adc77ec2 100644 (file)
 #    under the License.
 # @author: Kevin Benton, kevin.benton@bigswitch.com
 
-import eventlet
 import sys
 import time
 
+import eventlet
+eventlet.monkey_patch()
+
 from oslo.config import cfg
 
 from neutron.agent.linux import ovs_lib
@@ -162,7 +164,6 @@ class RestProxyAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin):
 
 
 def main():
-    eventlet.monkey_patch()
     cfg.CONF(project='neutron')
     config.setup_logging(cfg.CONF)
     pl_config.register_config()
index 5b6b9e9b00daf324875c8c0b61d2a98892748274..032504d484e96d9a42181737c3fba2a104278c17 100644 (file)
 # @author: Pedro Navarro Perez
 # @author: Alessandro Pilotti, Cloudbase Solutions Srl
 
-import eventlet
 import platform
 import re
 import time
 
+import eventlet
+eventlet.monkey_patch()
+
 from oslo.config import cfg
 
 from neutron.agent.common import config
@@ -464,7 +466,6 @@ class HyperVNeutronAgent(object):
 
 
 def main():
-    eventlet.monkey_patch()
     cfg.CONF(project='neutron')
     logging_config.setup_logging(cfg.CONF)
 
index 03b419ceea375f88362623abce4ad97e257fc70e..dea26bdbd5a718b71d424e49f008eda38fbf9e27 100644 (file)
@@ -21,6 +21,8 @@ import socket
 import time
 
 import eventlet
+eventlet.monkey_patch()
+
 from oslo.config import cfg
 
 from neutron.agent.linux import ip_lib
@@ -252,7 +254,6 @@ def create_agent_config_map(config):
 
 
 def main():
-    eventlet.monkey_patch()
     cfg.CONF.register_opts(ip_lib.OPTS)
     cfg.CONF(project='neutron')
     logging_config.setup_logging(cfg.CONF)
index 5e5c1524362c61168368745d26552985d3b461be..5d215791a6574f638ac8ea659a2c6536c54f6944 100755 (executable)
@@ -27,6 +27,8 @@ import sys
 import time
 
 import eventlet
+eventlet.monkey_patch()
+
 from oslo.config import cfg
 
 from neutron.agent import l2population_rpc as l2pop_rpc
@@ -1025,7 +1027,6 @@ class LinuxBridgeNeutronAgentRPC(sg_rpc.SecurityGroupAgentRpcMixin):
 
 
 def main():
-    eventlet.monkey_patch()
     cfg.CONF(project='neutron')
 
     logging_config.setup_logging(cfg.CONF)
index 35bc015f07eda3270ea7989d9a5cc840ece024a7..00ffdd6fdb8f56428200768a33bcddf8222529f7 100644 (file)
@@ -21,6 +21,8 @@ import sys
 import time
 
 import eventlet
+eventlet.monkey_patch()
+
 from oslo.config import cfg
 
 from neutron.agent import rpc as agent_rpc
@@ -417,7 +419,6 @@ class MlnxEswitchNeutronAgent(sg_rpc.SecurityGroupAgentRpcMixin):
 
 
 def main():
-    eventlet.monkey_patch()
     cfg.CONF(project='neutron')
     logging_config.setup_logging(cfg.CONF)
 
index 8ce6426c394ebd96d86c7594f86c318ed92f4324..c2d70fbfe0bdcad9d4ebb4974b949579acdad921 100755 (executable)
@@ -24,6 +24,7 @@ import socket
 import time
 
 import eventlet
+eventlet.monkey_patch()
 
 from neutron.agent.linux import ovs_lib
 from neutron.agent import rpc as agent_rpc
@@ -230,8 +231,6 @@ class NECNeutronAgent(object):
 
 
 def main():
-    eventlet.monkey_patch()
-
     config.CONF(project='neutron')
 
     logging_config.setup_logging(config.CONF)
index a857cff829183150101a69dc8f065a9725d6545d..f023a5787075647e4e36557df57360f1c08188f7 100644 (file)
@@ -20,6 +20,7 @@ import socket
 import time
 
 import eventlet
+eventlet.monkey_patch()
 
 from neutron.agent.linux import ovs_lib
 from neutron.agent import rpc as agent_rpc
@@ -160,7 +161,6 @@ class NVSDNeutronAgent(object):
 
 
 def main():
-    eventlet.monkey_patch()
     config.CONF(project='neutron')
     logging_config.setup_logging(config.CONF)
 
index 02d81bcd8b73c402ddaaba56011c20fae9c4be59..c0dce0620b8e169d89cee353be90ee13f311e5cb 100644 (file)
@@ -19,6 +19,8 @@ import sys
 import time
 
 import eventlet
+eventlet.monkey_patch()
+
 import netaddr
 from oslo.config import cfg
 from six import moves
@@ -1461,7 +1463,6 @@ def create_agent_config_map(config):
 
 
 def main():
-    eventlet.monkey_patch()
     cfg.CONF.register_opts(ip_lib.OPTS)
     cfg.CONF(project='neutron')
     logging_config.setup_logging(cfg.CONF)
index 7b16f60289d04a7312f5bdd026329dcc98d28d0f..01a4fba5ea97119666311248edf151a75ec3a140 100755 (executable)
@@ -24,6 +24,8 @@ import sys
 import time
 
 import eventlet
+eventlet.monkey_patch()
+
 from oslo.config import cfg
 from ryu.app import client
 from ryu.app import conf_switch_key
@@ -282,7 +284,6 @@ class OVSNeutronOFPRyuAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin):
 
 
 def main():
-    eventlet.monkey_patch()
     cfg.CONF(project='neutron')
 
     logging_config.setup_logging(cfg.CONF)
index 8d641ce2e8bd31bae0bbd169350bfe7564a77386..fa0cd1f3eb0a6c3769729598257e3f376c72612a 100644 (file)
 # under the License.
 #
 
-import eventlet
 import time
 
+import eventlet
+eventlet.monkey_patch()
+
 from neutron.openstack.common import log as logging
 from neutron.plugins.vmware.api_client import base
 from neutron.plugins.vmware.api_client import eventlet_request
 
-eventlet.monkey_patch()
 LOG = logging.getLogger(__name__)
 
 
index d5177cb237b64515dc50d9f2839515d99ce3ffc6..fedefa079d8d8a0cd158149c08b298cc0004fb11 100755 (executable)
 # If ../neutron/__init__.py exists, add ../ to Python search path, so that
 # it will override what happens to be installed in /usr/(local/)lib/python...
 
-import eventlet
 import sys
 
+import eventlet
+eventlet.monkey_patch()
+
 from oslo.config import cfg
 
 from neutron.common import config
@@ -34,8 +36,6 @@ LOG = logging.getLogger(__name__)
 
 
 def main():
-    eventlet.monkey_patch()
-
     # the configuration will be read into the cfg.CONF global data structure
     config.parse(sys.argv[1:])
     if not cfg.CONF.config_file:
index 4fc7c72d7c422d479f33efc1bc3451e721bbb493..881127b151d21f5c120af9781b0cec228b519d35 100755 (executable)
@@ -19,6 +19,8 @@
 #
 
 import eventlet
+eventlet.monkey_patch()
+
 import netaddr
 from oslo.config import cfg
 
@@ -327,7 +329,6 @@ class vArmourL3NATAgentWithStateReport(vArmourL3NATAgent,
 
 
 def main():
-    eventlet.monkey_patch()
     conf = cfg.CONF
     conf.register_opts(vArmourL3NATAgent.OPTS)
     config.register_interface_driver_opts_helper(conf)
index d9cc64658e5fa30c4b501ce88768a6bdf45894e0..0ec14554d9b8f419b71bb74c136aba146938e6e3 100644 (file)
@@ -17,6 +17,8 @@
 # @author: Mark McClain, DreamHost
 
 import eventlet
+eventlet.monkey_patch()
+
 from oslo.config import cfg
 
 from neutron.agent.common import config
@@ -47,7 +49,6 @@ class LbaasAgentService(rpc_service.Service):
 
 
 def main():
-    eventlet.monkey_patch()
     cfg.CONF.register_opts(OPTS)
     cfg.CONF.register_opts(manager.OPTS)
     # import interface options just in case the driver uses namespaces
index 7f1942562dbfb5bd24757ee50b6bab458ac61ef8..6bf1117d076d767c9bf83135a04b52aa47b5d86c 100644 (file)
@@ -25,6 +25,8 @@ import time
 
 
 import eventlet
+eventlet.monkey_patch(thread=True)
+
 from oslo.config import cfg
 
 from neutron.api.v2 import attributes
@@ -39,8 +41,6 @@ from neutron.plugins.common import constants
 from neutron.services.loadbalancer.drivers import abstract_driver
 from neutron.services.loadbalancer.drivers.radware import exceptions as r_exc
 
-eventlet.monkey_patch(thread=True)
-
 LOG = logging.getLogger(__name__)
 
 RESP_STATUS = 0
index a3a20ea5af844c5ba1a089bfad7d6ca28f5365e0..d1bd3c965da1509d0f4324468502243dac424e85 100644 (file)
@@ -17,6 +17,8 @@
 import time
 
 import eventlet
+eventlet.monkey_patch()
+
 from oslo.config import cfg
 
 from neutron.agent.common import config
@@ -281,7 +283,6 @@ class MeteringAgentWithStateReport(MeteringAgent):
 
 
 def main():
-    eventlet.monkey_patch()
     conf = cfg.CONF
     conf.register_opts(MeteringAgent.Opts)
     config.register_agent_state_opts_helper(conf)
index 816b763752fdec59f8b73d7e2c21342316d81ed7..1ddcbbd056fb0ad585f67f9cee0770446bec2c31 100644 (file)
@@ -213,14 +213,12 @@ class TestHyperVNeutronAgent(base.BaseTestCase):
         with mock.patch.object(hyperv_neutron_agent,
                                'HyperVNeutronAgent') as plugin:
             with mock.patch.object(hyperv_neutron_agent.cfg, 'CONF') as cfg:
-                with mock.patch('eventlet.monkey_patch') as eventlet:
-                    with mock.patch.object(
-                        hyperv_neutron_agent,
-                        'logging_config') as logging_config:
+                with mock.patch.object(
+                    hyperv_neutron_agent,
+                    'logging_config') as logging_config:
 
-                        hyperv_neutron_agent.main()
+                    hyperv_neutron_agent.main()
 
-                        self.assertTrue(cfg.called)
-                        self.assertTrue(eventlet.called)
-                        self.assertTrue(logging_config.setup_logging.called)
-                        plugin.assert_has_calls([mock.call().daemon_loop()])
+                    self.assertTrue(cfg.called)
+                    self.assertTrue(logging_config.setup_logging.called)
+                    plugin.assert_has_calls([mock.call().daemon_loop()])
index f23cece8159c2c628ffe44b99a320561ecb40cd0..16e4031c57f04754fc2e5ce2527d099be79fd15d 100644 (file)
@@ -350,17 +350,15 @@ class TestNecAgentMain(base.BaseTestCase):
     def test_main(self):
         with contextlib.nested(
             mock.patch.object(nec_neutron_agent, 'NECNeutronAgent'),
-            mock.patch('eventlet.monkey_patch'),
             mock.patch.object(nec_neutron_agent, 'logging_config'),
             mock.patch.object(nec_neutron_agent, 'config')
-        ) as (agent, eventlet, logging_config, cfg):
+        ) as (agent, logging_config, cfg):
             cfg.OVS.integration_bridge = 'br-int-x'
             cfg.AGENT.root_helper = 'dummy-helper'
             cfg.AGENT.polling_interval = 10
 
             nec_neutron_agent.main()
 
-            self.assertTrue(eventlet.called)
             self.assertTrue(logging_config.setup_logging.called)
             agent.assert_has_calls([
                 mock.call('br-int-x', 'dummy-helper', 10),
index 2243aa6ec5d0b9fcfefdb473277f981afa1b76b0..1a98c1274cdaa5f22a1271cdcad8a75575db0aae 100644 (file)
@@ -161,17 +161,15 @@ class TestOneConvergenceAgentMain(base.BaseTestCase):
     def test_main(self):
         with contextlib.nested(
             mock.patch.object(nvsd_neutron_agent, 'NVSDNeutronAgent'),
-            mock.patch('eventlet.monkey_patch'),
             mock.patch.object(nvsd_neutron_agent, 'logging_config'),
             mock.patch.object(nvsd_neutron_agent, 'config')
-        ) as (agent, eventlet, logging_config, config):
+        ) as (agent, logging_config, config):
             config.AGENT.integration_bridge = 'br-int-dummy'
             config.AGENT.root_helper = 'root-helper'
             config.AGENT.polling_interval = 5
 
             nvsd_neutron_agent.main()
 
-            self.assertTrue(eventlet.called)
             self.assertTrue(logging_config.setup_logging.called)
             agent.assert_has_calls([
                 mock.call('br-int-dummy', 'root-helper', 5),
index ef66e29219af819d279b18cac5c33200fd3fa1fe..b00c5233008c935789b363a63bf260a47debd6ed 100644 (file)
@@ -42,12 +42,10 @@ class TestLbaasService(base.BaseTestCase):
         with contextlib.nested(
             mock.patch(logging_str),
             mock.patch.object(agent.service, 'launch'),
-            mock.patch.object(agent, 'eventlet'),
             mock.patch('sys.argv'),
             mock.patch.object(agent.manager, 'LbaasAgentManager'),
             mock.patch.object(cfg.CONF, 'register_opts')
-        ) as (mock_logging, mock_launch, mock_eventlet, sys_argv, mgr_cls, ro):
+        ) as (mock_logging, mock_launch, sys_argv, mgr_cls, ro):
             agent.main()
 
-            self.assertTrue(mock_eventlet.monkey_patch.called)
             mock_launch.assert_called_once_with(mock.ANY)
index 2185e469d92b8b8caefa8e7e92478047f5228eeb..872adaef39034bf25fe0af459c75bdbd0299b711 100644 (file)
@@ -551,18 +551,16 @@ class TestUnixDomainMetadataProxy(base.BaseTestCase):
 
     def test_main(self):
         with mock.patch.object(agent, 'UnixDomainMetadataProxy') as proxy:
-            with mock.patch('eventlet.monkey_patch') as eventlet:
-                with mock.patch.object(agent, 'config') as config:
-                    with mock.patch.object(agent, 'cfg') as cfg:
-                        with mock.patch.object(utils, 'cfg'):
-                            agent.main()
-
-                            self.assertTrue(eventlet.called)
-                            self.assertTrue(config.setup_logging.called)
-                            proxy.assert_has_calls([
-                                mock.call(cfg.CONF),
-                                mock.call().run()]
-                            )
+            with mock.patch.object(agent, 'config') as config:
+                with mock.patch.object(agent, 'cfg') as cfg:
+                    with mock.patch.object(utils, 'cfg'):
+                        agent.main()
+
+                        self.assertTrue(config.setup_logging.called)
+                        proxy.assert_has_calls([
+                            mock.call(cfg.CONF),
+                            mock.call().run()]
+                        )
 
     def test_init_state_reporting(self):
         with mock.patch('os.makedirs'):
index 8aafc33a45eba8620e6163f1244dbdb77dca13f1..416a113b36f43f1a5dc3ee54fee5a13129165234 100644 (file)
@@ -312,46 +312,42 @@ class TestProxyDaemon(base.BaseTestCase):
 
     def test_main(self):
         with mock.patch.object(ns_proxy, 'ProxyDaemon') as daemon:
-            with mock.patch('eventlet.monkey_patch') as eventlet:
-                with mock.patch.object(ns_proxy, 'config') as config:
-                    with mock.patch.object(ns_proxy, 'cfg') as cfg:
-                        with mock.patch.object(utils, 'cfg') as utils_cfg:
-                            cfg.CONF.router_id = 'router_id'
-                            cfg.CONF.network_id = None
-                            cfg.CONF.metadata_port = 9697
-                            cfg.CONF.pid_file = 'pidfile'
-                            cfg.CONF.daemonize = True
-                            utils_cfg.CONF.log_opt_values.return_value = None
-                            ns_proxy.main()
-
-                            self.assertTrue(eventlet.called)
-                            self.assertTrue(config.setup_logging.called)
-                            daemon.assert_has_calls([
-                                mock.call('pidfile', 9697,
-                                          router_id='router_id',
-                                          network_id=None),
-                                mock.call().start()]
-                            )
+            with mock.patch.object(ns_proxy, 'config') as config:
+                with mock.patch.object(ns_proxy, 'cfg') as cfg:
+                    with mock.patch.object(utils, 'cfg') as utils_cfg:
+                        cfg.CONF.router_id = 'router_id'
+                        cfg.CONF.network_id = None
+                        cfg.CONF.metadata_port = 9697
+                        cfg.CONF.pid_file = 'pidfile'
+                        cfg.CONF.daemonize = True
+                        utils_cfg.CONF.log_opt_values.return_value = None
+                        ns_proxy.main()
+
+                        self.assertTrue(config.setup_logging.called)
+                        daemon.assert_has_calls([
+                            mock.call('pidfile', 9697,
+                                      router_id='router_id',
+                                      network_id=None),
+                            mock.call().start()]
+                        )
 
     def test_main_dont_fork(self):
         with mock.patch.object(ns_proxy, 'ProxyDaemon') as daemon:
-            with mock.patch('eventlet.monkey_patch') as eventlet:
-                with mock.patch.object(ns_proxy, 'config') as config:
-                    with mock.patch.object(ns_proxy, 'cfg') as cfg:
-                        with mock.patch.object(utils, 'cfg') as utils_cfg:
-                            cfg.CONF.router_id = 'router_id'
-                            cfg.CONF.network_id = None
-                            cfg.CONF.metadata_port = 9697
-                            cfg.CONF.pid_file = 'pidfile'
-                            cfg.CONF.daemonize = False
-                            utils_cfg.CONF.log_opt_values.return_value = None
-                            ns_proxy.main()
-
-                            self.assertTrue(eventlet.called)
-                            self.assertTrue(config.setup_logging.called)
-                            daemon.assert_has_calls([
-                                mock.call('pidfile', 9697,
-                                          router_id='router_id',
-                                          network_id=None),
-                                mock.call().run()]
-                            )
+            with mock.patch.object(ns_proxy, 'config') as config:
+                with mock.patch.object(ns_proxy, 'cfg') as cfg:
+                    with mock.patch.object(utils, 'cfg') as utils_cfg:
+                        cfg.CONF.router_id = 'router_id'
+                        cfg.CONF.network_id = None
+                        cfg.CONF.metadata_port = 9697
+                        cfg.CONF.pid_file = 'pidfile'
+                        cfg.CONF.daemonize = False
+                        utils_cfg.CONF.log_opt_values.return_value = None
+                        ns_proxy.main()
+
+                        self.assertTrue(config.setup_logging.called)
+                        daemon.assert_has_calls([
+                            mock.call('pidfile', 9697,
+                                      router_id='router_id',
+                                      network_id=None),
+                            mock.call().run()]
+                        )
index c13c8034826df446f733bc6fd8df58ffd4b7966c..4487d654aef3dc6c6dc8b9b2ba481492b5dc3fef 100644 (file)
@@ -30,7 +30,7 @@ from xml.etree import ElementTree as etree
 from xml.parsers import expat
 
 import eventlet.wsgi
-eventlet.patcher.monkey_patch(all=False, socket=True)
+eventlet.patcher.monkey_patch(all=False, socket=True, thread=True)
 from oslo.config import cfg
 import routes.middleware
 import webob.dec