diff --git a/ironic/tests/unit/__init__.py b/ironic/tests/unit/__init__.py index 9b42693939..96a25958c9 100644 --- a/ironic/tests/unit/__init__.py +++ b/ironic/tests/unit/__init__.py @@ -22,15 +22,20 @@ :platform: Unix """ -# TODO(tenbrae): move eventlet imports to ironic.__init__ once we move to PBR - import eventlet -from oslo_config import cfg -from oslo_log import log -from ironic import objects -eventlet.monkey_patch() +# NOTE(JayF): We must green all python stdlib modules before anything else +# is imported for consistent behavior. For instance, sqlalchemy +# creates a threading.RLock early, and if it was imported before +eventlet.monkey_patch() # noqa + + +from oslo_config import cfg # noqa E402 +from oslo_log import log # noqa E402 + +from ironic import objects # noqa E402 + log.register_options(cfg.CONF) log.setup(cfg.CONF, 'ironic')