Fix py27 eventlet issue <0.22.0

Closes-Bug: #1744824

Change-Id: Ib9f8a52136e25d1cb609d465ca5d859523d9acc6
This commit is contained in:
Erno Kuvaja 2018-01-25 16:16:22 +00:00 committed by Brian Rosmaita
parent 603506d927
commit 6f63d28d9b
4 changed files with 24 additions and 0 deletions

View File

@ -29,6 +29,12 @@ from oslo_utils import encodeutils
# Monkey patch socket, time, select, threads
# NOTE(jokke): As per the eventlet commit
# b756447bab51046dfc6f1e0e299cc997ab343701 there's circular import happening
# which can be solved making sure the hubs are properly and fully imported
# before calling monkey_patch(). This is solved in eventlet 0.22.0 but we
# need to address it before that is widely used around.
eventlet.hubs.get_hub()
eventlet.patcher.monkey_patch(all=False, socket=True, time=True,
select=True, thread=True, os=True)

View File

@ -28,6 +28,12 @@ import eventlet
from oslo_utils import encodeutils
# Monkey patch socket and time
# NOTE(jokke): As per the eventlet commit
# b756447bab51046dfc6f1e0e299cc997ab343701 there's circular import happening
# which can be solved making sure the hubs are properly and fully imported
# before calling monkey_patch(). This is solved in eventlet 0.22.0 but we
# need to address it before that is widely used around.
eventlet.hubs.get_hub()
eventlet.patcher.monkey_patch(all=False, socket=True, time=True, thread=True)
# If ../glance/__init__.py exists, add ../ to Python search path, so that

View File

@ -38,6 +38,12 @@ from oslo_log import log as logging
from glance.common import config
from glance import scrubber
# NOTE(jokke): As per the eventlet commit
# b756447bab51046dfc6f1e0e299cc997ab343701 there's circular import happening
# which can be solved making sure the hubs are properly and fully imported
# before calling monkey_patch(). This is solved in eventlet 0.22.0 but we
# need to address it before that is widely used around.
eventlet.hubs.get_hub()
eventlet.patcher.monkey_patch(all=False, socket=True, time=True, select=True,
thread=True, os=True)

View File

@ -28,4 +28,10 @@ logger.addHandler(hdlr)
logger.setLevel(logging.DEBUG)
import eventlet
# NOTE(jokke): As per the eventlet commit
# b756447bab51046dfc6f1e0e299cc997ab343701 there's circular import happening
# which can be solved making sure the hubs are properly and fully imported
# before calling monkey_patch(). This is solved in eventlet 0.22.0 but we
# need to address it before that is widely used around.
eventlet.hubs.get_hub()
eventlet.patcher.monkey_patch()