summaryrefslogtreecommitdiff
path: root/ironic/cmd
diff options
context:
space:
mode:
authorCorey Bryant <corey.bryant@canonical.com>2020-05-04 13:44:44 -0400
committerCorey Bryant <corey.bryant@canonical.com>2020-05-04 16:39:06 -0400
commit627d4dfd1ae6ee35a190f92c1d812aaa1146b7d9 (patch)
treeca2438d3dc822528b9a42335f3c0ff31c6a0cb8c /ironic/cmd
parent82c26635648ac2e8fa7e0ae4c802a66ba4436637 (diff)
downloadironic-627d4dfd1ae6ee35a190f92c1d812aaa1146b7d9.tar.gz
Monkey patch original current_thread _active
Monkey patch the original current_thread to use the up-to-date _active global variable. This solution is based on that documented at: https://github.com/eventlet/eventlet/issues/592 Change-Id: I97c2a756076299a01170beb5bec3fa0e49593146 Story: 2007614
Diffstat (limited to 'ironic/cmd')
-rw-r--r--ironic/cmd/__init__.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ironic/cmd/__init__.py b/ironic/cmd/__init__.py
index 8acedfa92..bd47b11ac 100644
--- a/ironic/cmd/__init__.py
+++ b/ironic/cmd/__init__.py
@@ -24,6 +24,12 @@ os.environ['EVENTLET_NO_GREENDNS'] = 'yes' # noqa E402
import eventlet
eventlet.monkey_patch(os=False)
+# Monkey patch the original current_thread to use the up-to-date _active
+# global variable. See https://bugs.launchpad.net/bugs/1863021 and
+# https://github.com/eventlet/eventlet/issues/592
+import __original_module_threading as orig_threading # noqa
+import threading # noqa
+orig_threading.current_thread.__globals__['_active'] = threading._active
from ironic.common import i18n # noqa for I202 due to 'import eventlet' above