Skip to content

Commit

Permalink
teuthology/__init__.py: don't patch threads when running via teutholo…
Browse files Browse the repository at this point in the history
…gy_api

The project [teuthology-api](https://github.com/ceph/teuthology-api)
requires threads to be not patched.
Currently, we are using "teuth-api" branch of teuthology where threads are
not patched. With this commit, we'll be able to use the "main" branch as
a dependency.

Signed-off-by: Vallari Agrawal <[email protected]>
  • Loading branch information
VallariAg committed Feb 13, 2024
1 parent d9fdb22 commit d0202a7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion teuthology/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from __future__ import print_function
import os
import os, sys
try:
import importlib.metadata as importlib_metadata
except ImportError:
Expand All @@ -24,10 +24,15 @@
except ImportError:
pass
from gevent import monkey
patch_threads=True
for arg in sys.argv:
if "teuthology_api" in arg:
patch_threads=False
monkey.patch_all(
dns=False,
# Don't patch subprocess to avoid http://tracker.ceph.com/issues/14990
subprocess=False,
thread=patch_threads,
)
import sys
from gevent.hub import Hub
Expand Down

0 comments on commit d0202a7

Please sign in to comment.