From 05b57fee7a7316e46b24928ab0c081381017771b Mon Sep 17 00:00:00 2001 From: caoyuan Date: Sat, 21 Oct 2017 14:14:23 +0800 Subject: [PATCH] Unify the oslo_log import usage In watcher project, some py file use "from oslo_log import log as logging" for import, but more use "from oslo_log import log" like https://github.com/openstack/watcher/blob/master/watcher/decision_engine/strategy/strategies/dummy_strategy.py#L19 this patch to unify it. Change-Id: I9c667bb202bebc7942d1af5ce438375285c2e2ba --- watcher/cmd/api.py | 4 ++-- watcher/cmd/applier.py | 4 ++-- watcher/cmd/decisionengine.py | 4 ++-- watcher/cmd/sync.py | 4 ++-- watcher/common/context.py | 4 ++-- watcher/common/exception.py | 4 ++-- watcher/common/utils.py | 4 ++-- watcher/decision_engine/solution/efficacy.py | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/watcher/cmd/api.py b/watcher/cmd/api.py index 58c27e28a..214cfc255 100644 --- a/watcher/cmd/api.py +++ b/watcher/cmd/api.py @@ -20,13 +20,13 @@ import sys from oslo_config import cfg -from oslo_log import log as logging +from oslo_log import log from watcher.api import scheduling from watcher.common import service from watcher import conf -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) CONF = conf.CONF diff --git a/watcher/cmd/applier.py b/watcher/cmd/applier.py index 088a9a91a..8db5a2491 100644 --- a/watcher/cmd/applier.py +++ b/watcher/cmd/applier.py @@ -20,14 +20,14 @@ import os import sys -from oslo_log import log as logging +from oslo_log import log from watcher.applier import manager from watcher.applier import sync from watcher.common import service as watcher_service from watcher import conf -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) CONF = conf.CONF diff --git a/watcher/cmd/decisionengine.py b/watcher/cmd/decisionengine.py index ac172ee55..9b4f517fd 100644 --- a/watcher/cmd/decisionengine.py +++ b/watcher/cmd/decisionengine.py @@ -20,7 +20,7 @@ import os import sys -from oslo_log import log as logging +from oslo_log import log from watcher.common import service as watcher_service from watcher import conf @@ -29,7 +29,7 @@ from watcher.decision_engine import manager from watcher.decision_engine import scheduling from watcher.decision_engine import sync -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) CONF = conf.CONF diff --git a/watcher/cmd/sync.py b/watcher/cmd/sync.py index c0cbf3888..3545a780e 100644 --- a/watcher/cmd/sync.py +++ b/watcher/cmd/sync.py @@ -20,13 +20,13 @@ import sys -from oslo_log import log as logging +from oslo_log import log from watcher.common import service as service from watcher import conf from watcher.decision_engine import sync -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) CONF = conf.CONF diff --git a/watcher/common/context.py b/watcher/common/context.py index 99fcb797b..741f307c7 100644 --- a/watcher/common/context.py +++ b/watcher/common/context.py @@ -11,11 +11,11 @@ # under the License. from oslo_context import context -from oslo_log import log as logging +from oslo_log import log from oslo_utils import timeutils import six -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class RequestContext(context.RequestContext): diff --git a/watcher/common/exception.py b/watcher/common/exception.py index 3eb36b251..1336c8b8a 100644 --- a/watcher/common/exception.py +++ b/watcher/common/exception.py @@ -26,14 +26,14 @@ import functools import sys from keystoneclient import exceptions as keystone_exceptions -from oslo_log import log as logging +from oslo_log import log import six from watcher._i18n import _ from watcher import conf -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) CONF = conf.CONF diff --git a/watcher/common/utils.py b/watcher/common/utils.py index 16e97384f..3a3408de3 100644 --- a/watcher/common/utils.py +++ b/watcher/common/utils.py @@ -24,7 +24,7 @@ import string from croniter import croniter from jsonschema import validators -from oslo_log import log as logging +from oslo_log import log from oslo_utils import strutils from oslo_utils import uuidutils import six @@ -35,7 +35,7 @@ from watcher import conf CONF = conf.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class Struct(dict): diff --git a/watcher/decision_engine/solution/efficacy.py b/watcher/decision_engine/solution/efficacy.py index 108e78fe3..31ff4f3bb 100644 --- a/watcher/decision_engine/solution/efficacy.py +++ b/watcher/decision_engine/solution/efficacy.py @@ -16,13 +16,13 @@ import numbers -from oslo_log import log as logging +from oslo_log import log from watcher._i18n import _ from watcher.common import exception from watcher.common import utils -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class IndicatorsMap(utils.Struct):