summaryrefslogtreecommitdiff
path: root/ironic/tests/unit/__init__.py
diff options
context:
space:
mode:
authorVladyslav Drok <vdrok@mirantis.com>2017-04-13 20:42:14 +0300
committerVladyslav Drok <vdrok@mirantis.com>2017-04-13 20:47:10 +0300
commite66ca5557903cd2544ea0e9920108da811caeee0 (patch)
tree9eb7bc6a9aca796708d3b3b2ee3eac06f97db43d /ironic/tests/unit/__init__.py
parent20815f5d87d22592b2c9bd5d11c811e38be9d13a (diff)
downloadironic-e66ca5557903cd2544ea0e9920108da811caeee0.tar.gz
Setup logging in unit tests
We do not setup logging at the beginning of the unit test runs, which can cause oslo_log complaining about no handler for logging, depending on the import order: No handlers could be found for logger "ironic.drivers.modules.deploy_utils" This change adds logging in the unit tests __init__ module. Change-Id: I455c139a689aa8146ca1d985ef6900e73cef6558
Diffstat (limited to 'ironic/tests/unit/__init__.py')
-rw-r--r--ironic/tests/unit/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ironic/tests/unit/__init__.py b/ironic/tests/unit/__init__.py
index d1cd870f2..2abf56519 100644
--- a/ironic/tests/unit/__init__.py
+++ b/ironic/tests/unit/__init__.py
@@ -25,11 +25,16 @@
# TODO(deva): 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(os=False)
+log.register_options(cfg.CONF)
+log.setup(cfg.CONF, 'ironic')
+
# NOTE(comstud): Make sure we have all of the objects loaded. We do this
# at module import time, because we may be using mock decorators in our
# tests that run at import time.