diff --git a/bin/heat-keystone-setup-domain b/bin/heat-keystone-setup-domain index 5210a635a8..dc502fc519 100755 --- a/bin/heat-keystone-setup-domain +++ b/bin/heat-keystone-setup-domain @@ -12,13 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. -import logging import os import sys import keystoneclient.exceptions as kc_exception from keystoneclient.v3 import client from oslo_config import cfg +from oslo_log import log as logging from heat import version diff --git a/heat/common/config.py b/heat/common/config.py index da7483f541..15b5af51a2 100644 --- a/heat/common/config.py +++ b/heat/common/config.py @@ -12,7 +12,6 @@ # under the License. """Routines for configuring Heat.""" -import logging as sys_logging import os from eventlet.green import socket @@ -438,7 +437,7 @@ def load_paste_app(app_name=None): # Log the options used when starting if we're in debug mode... if cfg.CONF.debug: cfg.CONF.log_opt_values(logging.getLogger(app_name), - sys_logging.DEBUG) + logging.DEBUG) return app except (LookupError, ImportError) as e: diff --git a/heat/common/wsgi.py b/heat/common/wsgi.py index 9816020203..1bc004eba3 100644 --- a/heat/common/wsgi.py +++ b/heat/common/wsgi.py @@ -20,7 +20,6 @@ import abc import errno -import logging as std_logging import os import signal import sys @@ -256,7 +255,7 @@ def get_socket(conf, default_port): class WritableLogger(object): """A thin wrapper that responds to `write` and logs.""" - def __init__(self, LOG, level=std_logging.DEBUG): + def __init__(self, LOG, level=logging.DEBUG): self.LOG = LOG self.level = level diff --git a/heat/engine/clients/os/cinder.py b/heat/engine/clients/os/cinder.py index 95ce32250d..a1f2b0da63 100644 --- a/heat/engine/clients/os/cinder.py +++ b/heat/engine/clients/os/cinder.py @@ -11,11 +11,10 @@ # License for the specific language governing permissions and limitations # under the License. -import logging - from cinderclient import client as cc from cinderclient import exceptions from keystoneclient import exceptions as ks_exceptions +from oslo_log import log as logging from heat.common import exception from heat.common.i18n import _ diff --git a/heat/engine/clients/os/nova.py b/heat/engine/clients/os/nova.py index 2bc42f81b2..ba74a67c76 100644 --- a/heat/engine/clients/os/nova.py +++ b/heat/engine/clients/os/nova.py @@ -15,7 +15,6 @@ import collections import email from email.mime import multipart from email.mime import text -import logging import os import pkgutil import string @@ -23,6 +22,7 @@ import string from novaclient import client as nc from novaclient import exceptions from oslo_config import cfg +from oslo_log import log as logging from oslo_serialization import jsonutils from oslo_utils import uuidutils import six diff --git a/heat/tests/common.py b/heat/tests/common.py index 6889e2368b..cdbf28ce91 100644 --- a/heat/tests/common.py +++ b/heat/tests/common.py @@ -11,14 +11,13 @@ # License for the specific language governing permissions and limitations # under the License. - -import logging import os import sys import fixtures import mox from oslo_config import cfg +from oslo_log import log as logging from oslotest import mockpatch import testscenarios import testtools @@ -60,7 +59,8 @@ class FakeLogMixin(object): self.LOG = self.useFixture( fixtures.FakeLogger(level=default_level, format=_LOG_FORMAT)) base_list = set([nlog.split('.')[0] - for nlog in logging.Logger.manager.loggerDict]) + for nlog in logging.logging.Logger.manager.loggerDict] + ) for base in base_list: if base in TEST_DEFAULT_LOGLEVELS: self.useFixture(fixtures.FakeLogger( diff --git a/heat/tests/test_stack_delete.py b/heat/tests/test_stack_delete.py index a70741ab5e..944e4e06b7 100644 --- a/heat/tests/test_stack_delete.py +++ b/heat/tests/test_stack_delete.py @@ -13,7 +13,7 @@ import copy import fixtures -import logging +from oslo_log import log as logging import time from keystoneclient import exceptions as kc_exceptions