Eventlet utils helper module.

New in version 1.3.


Get the current thread.

If eventlet is used to monkey-patch the threading module, return the current eventlet greenthread. Otherwise, return the current Python thread.

New in version 1.5.


Determines safely is eventlet patching for module enabled or not :param module: String, module name :return Bool, True if module is patched, False otherwise

oslo_utils.eventletutils.warn_eventlet_not_patched(expected_patched_modules=None, what='this library')

Warns if eventlet is being used without patching provided modules.

  • expected_patched_modules (list/tuple/iterable) – list of modules to check to ensure that they are patched (and to warn if they are not); these names should correspond to the names passed into the eventlet monkey_patch() routine. If not provided then all the modules that could be patched are checked. The currently valid selection is one or multiple of [‘MySQLdb’, ‘__builtin__’, ‘all’, ‘os’, ‘psycopg’, ‘select’, ‘socket’, ‘thread’, ‘time’] (where ‘all’ has an inherent special meaning).
  • what (string) – string to merge into the warnings message to identify what is being checked (used in forming the emitted warnings message).
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.