diff --git a/manila/api/auth.py b/manila/api/auth.py index 6d52ff311e..c0eba459bd 100644 --- a/manila/api/auth.py +++ b/manila/api/auth.py @@ -14,12 +14,12 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log + from manila.api.middleware import auth from manila.i18n import _LW -from manila.openstack.common import log as logging - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class ManilaKeystoneContext(auth.ManilaKeystoneContext): diff --git a/manila/api/common.py b/manila/api/common.py index cf4243dc9c..2eb126ffd8 100644 --- a/manila/api/common.py +++ b/manila/api/common.py @@ -17,6 +17,7 @@ import os import re from oslo_config import cfg +from oslo_log import log import six from six.moves.urllib import parse import webob @@ -24,11 +25,10 @@ import webob from manila.api.openstack import wsgi from manila.api import xmlutil from manila.i18n import _ -from manila.openstack.common import log as logging from manila import utils CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) XML_NS_V1 = 'http://docs.openstack.org/volume/api/v1' diff --git a/manila/api/contrib/__init__.py b/manila/api/contrib/__init__.py index 7207d41e17..51cb73ee8e 100644 --- a/manila/api/contrib/__init__.py +++ b/manila/api/contrib/__init__.py @@ -20,12 +20,12 @@ It can't be called 'extensions' because that causes namespacing problems. """ from oslo_config import cfg +from oslo_log import log from manila.api import extensions -from manila.openstack.common import log as logging CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) def standard_extensions(ext_mgr): diff --git a/manila/api/contrib/admin_actions.py b/manila/api/contrib/admin_actions.py index 20f0e55537..dd9f0d20f3 100644 --- a/manila/api/contrib/admin_actions.py +++ b/manila/api/contrib/admin_actions.py @@ -12,6 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log import webob from webob import exc @@ -19,11 +20,9 @@ from manila.api import extensions from manila.api.openstack import wsgi from manila import db from manila import exception -from manila.openstack.common import log as logging from manila import share - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class AdminController(wsgi.Controller): diff --git a/manila/api/contrib/quotas.py b/manila/api/contrib/quotas.py index 47ab397ccc..594fa55b3f 100644 --- a/manila/api/contrib/quotas.py +++ b/manila/api/contrib/quotas.py @@ -13,7 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. - +from oslo_log import log from oslo_utils import strutils from six.moves.urllib import parse import webob @@ -25,12 +25,11 @@ from manila import db from manila.db.sqlalchemy import api as sqlalchemy_api from manila import exception from manila.i18n import _ -from manila.openstack.common import log as logging from manila import quota QUOTAS = quota.QUOTAS -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) NON_QUOTA_KEYS = ['tenant_id', 'id', 'force'] diff --git a/manila/api/contrib/services.py b/manila/api/contrib/services.py index c0c9bbdef9..a28f9a416a 100644 --- a/manila/api/contrib/services.py +++ b/manila/api/contrib/services.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log import webob.exc from manila.api import extensions @@ -20,11 +21,9 @@ from manila.api.openstack import wsgi from manila.api import xmlutil from manila import db from manila import exception -from manila.openstack.common import log as logging from manila import utils - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) authorize = extensions.extension_authorizer('share', 'services') diff --git a/manila/api/extensions.py b/manila/api/extensions.py index b6d2e739c9..a70aff165c 100644 --- a/manila/api/extensions.py +++ b/manila/api/extensions.py @@ -17,6 +17,7 @@ import os from oslo_config import cfg +from oslo_log import log from oslo_utils import importutils import six import webob.dec @@ -29,11 +30,10 @@ from manila import exception from manila.i18n import _LE from manila.i18n import _LI from manila.i18n import _LW -from manila.openstack.common import log as logging import manila.policy CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class ExtensionDescriptor(object): diff --git a/manila/api/middleware/auth.py b/manila/api/middleware/auth.py index 38e72b8182..1e798c9305 100644 --- a/manila/api/middleware/auth.py +++ b/manila/api/middleware/auth.py @@ -19,6 +19,7 @@ Common Auth Middleware. import os from oslo_config import cfg +from oslo_log import log from oslo_serialization import jsonutils import webob.dec import webob.exc @@ -26,7 +27,6 @@ import webob.exc from manila.api.openstack import wsgi from manila import context from manila.i18n import _ -from manila.openstack.common import log as logging from manila import wsgi as base_wsgi use_forwarded_for_opt = cfg.BoolOpt( @@ -37,7 +37,7 @@ use_forwarded_for_opt = cfg.BoolOpt( CONF = cfg.CONF CONF.register_opt(use_forwarded_for_opt) -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) def pipeline_factory(loader, global_conf, **local_conf): diff --git a/manila/api/middleware/fault.py b/manila/api/middleware/fault.py index e11250b5c9..d52648dbc6 100644 --- a/manila/api/middleware/fault.py +++ b/manila/api/middleware/fault.py @@ -14,6 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log import six import webob.dec import webob.exc @@ -21,12 +22,10 @@ import webob.exc from manila.api.openstack import wsgi from manila.i18n import _LE from manila.i18n import _LI -from manila.openstack.common import log as logging from manila import utils from manila import wsgi as base_wsgi - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class FaultWrapper(base_wsgi.Middleware): diff --git a/manila/api/middleware/sizelimit.py b/manila/api/middleware/sizelimit.py index 19bd2ffbe9..804bbc4d41 100644 --- a/manila/api/middleware/sizelimit.py +++ b/manila/api/middleware/sizelimit.py @@ -17,12 +17,11 @@ Request Body limiting middleware. """ from oslo_config import cfg +from oslo_log import log import webob.dec import webob.exc - from manila.i18n import _ -from manila.openstack.common import log as logging from manila import wsgi # default request size is 112k @@ -33,7 +32,7 @@ max_request_body_size_opt = cfg.IntOpt( CONF = cfg.CONF CONF.register_opt(max_request_body_size_opt) -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class LimitingReader(object): diff --git a/manila/api/openstack/__init__.py b/manila/api/openstack/__init__.py index e40f404cf1..7c01beb7dd 100644 --- a/manila/api/openstack/__init__.py +++ b/manila/api/openstack/__init__.py @@ -18,17 +18,16 @@ WSGI middleware for OpenStack API controllers. """ +from oslo_log import log import routes from manila.api.openstack import wsgi -from manila.openstack.common import log as logging from manila.i18n import _ from manila.i18n import _LW from manila import utils from manila import wsgi as base_wsgi - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class APIMapper(routes.Mapper): diff --git a/manila/api/openstack/urlmap.py b/manila/api/openstack/urlmap.py index db27b82d43..6482ac6285 100644 --- a/manila/api/openstack/urlmap.py +++ b/manila/api/openstack/urlmap.py @@ -14,12 +14,12 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log + from manila.api import urlmap -from manila.openstack.common import log as logging from manila.i18n import _LW - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) def urlmap_factory(loader, global_conf, **local_conf): diff --git a/manila/api/openstack/volume/__init__.py b/manila/api/openstack/volume/__init__.py index 227f918e4a..68cc203fa2 100644 --- a/manila/api/openstack/volume/__init__.py +++ b/manila/api/openstack/volume/__init__.py @@ -14,11 +14,12 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log + from manila.api.v1.router import APIRouter as v1_router from manila.i18n import _LW -from manila.openstack.common import log as logging -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class APIRouter(v1_router): diff --git a/manila/api/openstack/volume/versions.py b/manila/api/openstack/volume/versions.py index 80f02c544d..928daf275b 100644 --- a/manila/api/openstack/volume/versions.py +++ b/manila/api/openstack/volume/versions.py @@ -14,12 +14,12 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log + from manila.api import versions from manila.i18n import _ -from manila.openstack.common import log as logging - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class Versions(versions.Versions): diff --git a/manila/api/openstack/wsgi.py b/manila/api/openstack/wsgi.py index 296eed89a0..88ef81b2d9 100644 --- a/manila/api/openstack/wsgi.py +++ b/manila/api/openstack/wsgi.py @@ -15,6 +15,7 @@ import inspect import math +from oslo_log import log from oslo_serialization import jsonutils import six import time @@ -24,7 +25,6 @@ from manila import exception from manila.i18n import _ from manila.i18n import _LE from manila.i18n import _LI -from manila.openstack.common import log as logging from manila import utils from manila import wsgi @@ -36,7 +36,7 @@ from xml.parsers import expat XMLNS_V1 = 'http://docs.openstack.org/volume/api/v1' XMLNS_ATOM = 'http://www.w3.org/2005/Atom' -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) # The vendor content types should serialize identically to the non-vendor # content types. So to avoid littering the code with both options, we diff --git a/manila/api/sizelimit.py b/manila/api/sizelimit.py index 77c1f6199e..9fc26ce32a 100644 --- a/manila/api/sizelimit.py +++ b/manila/api/sizelimit.py @@ -14,11 +14,12 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log + from manila.api.middleware import sizelimit from manila.i18n import _LW -from manila.openstack.common import log as logging -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class RequestBodySizeLimiter(sizelimit.RequestBodySizeLimiter): diff --git a/manila/api/urlmap.py b/manila/api/urlmap.py index 86d971dfe3..3a22324daf 100644 --- a/manila/api/urlmap.py +++ b/manila/api/urlmap.py @@ -16,10 +16,10 @@ import re import urllib2 +from oslo_log import log import paste.urlmap from manila.api.openstack import wsgi -from manila.openstack.common import log as logging _quoted_string_re = r'"[^"\\]*(?:\\.[^"\\]*)*"' @@ -28,7 +28,7 @@ _option_header_piece_re = re.compile( r'(?:=\s*([^;]+|%s))?\s*' % (_quoted_string_re, _quoted_string_re)) -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) def unquote_header_value(value): diff --git a/manila/api/v1/router.py b/manila/api/v1/router.py index b52102ca7b..76d6e1bdd9 100644 --- a/manila/api/v1/router.py +++ b/manila/api/v1/router.py @@ -19,6 +19,8 @@ WSGI middleware for OpenStack Share API. """ +from oslo_log import log + from manila.api import extensions import manila.api.openstack from manila.api.v1 import limits @@ -30,10 +32,8 @@ from manila.api.v1 import share_snapshots from manila.api.v1 import shares from manila.api.v1 import volume_types from manila.api import versions -from manila.openstack.common import log as logging - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class APIRouter(manila.api.openstack.APIRouter): diff --git a/manila/api/v1/security_service.py b/manila/api/v1/security_service.py index a192c01eb6..4c3ad5924d 100644 --- a/manila/api/v1/security_service.py +++ b/manila/api/v1/security_service.py @@ -15,6 +15,7 @@ """The security service api.""" +from oslo_log import log import six import webob from webob import exc @@ -28,12 +29,11 @@ from manila import db from manila import exception from manila.i18n import _ from manila.i18n import _LI -from manila.openstack.common import log as logging from manila import policy RESOURCE_NAME = 'security_service' -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) def make_security_service(elem): diff --git a/manila/api/v1/share_networks.py b/manila/api/v1/share_networks.py index 9e259980e8..9d314b83e1 100644 --- a/manila/api/v1/share_networks.py +++ b/manila/api/v1/share_networks.py @@ -16,6 +16,7 @@ """The shares api.""" from oslo_db import exception as db_exception +from oslo_log import log from oslo_utils import timeutils import six import webob @@ -30,14 +31,13 @@ from manila import exception from manila.i18n import _ from manila.i18n import _LE from manila.i18n import _LW -from manila.openstack.common import log as logging from manila import policy from manila import quota from manila.share import rpcapi as share_rpcapi RESOURCE_NAME = 'share_network' RESOURCES_NAME = 'share_networks' -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) QUOTAS = quota.QUOTAS SHARE_NETWORK_ATTRS = ( 'id', diff --git a/manila/api/v1/share_servers.py b/manila/api/v1/share_servers.py index 3afc106e98..2c98fafba5 100644 --- a/manila/api/v1/share_servers.py +++ b/manila/api/v1/share_servers.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log import six import webob from webob import exc @@ -24,13 +25,12 @@ from manila.common import constants from manila.db import api as db_api from manila import exception from manila.i18n import _ -from manila.openstack.common import log as logging from manila import policy from manila import share RESOURCE_NAME = 'share_server' RESOURCES_NAME = 'share_servers' -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) SHARE_SERVER_ATTRS = ( 'id', 'project_id', diff --git a/manila/api/v1/share_snapshots.py b/manila/api/v1/share_snapshots.py index 66d6e61bc6..6f8e65ae01 100644 --- a/manila/api/v1/share_snapshots.py +++ b/manila/api/v1/share_snapshots.py @@ -15,6 +15,7 @@ """The share snapshots api.""" +from oslo_log import log import six import webob from webob import exc @@ -25,11 +26,9 @@ from manila.api.views import share_snapshots as snapshot_views from manila.api import xmlutil from manila import exception from manila.i18n import _LI -from manila.openstack.common import log as logging from manila import share - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) def make_snapshot(elem): diff --git a/manila/api/v1/shares.py b/manila/api/v1/shares.py index e4fab17b11..ab973386ee 100644 --- a/manila/api/v1/shares.py +++ b/manila/api/v1/shares.py @@ -17,6 +17,7 @@ import ast +from oslo_log import log from oslo_utils import uuidutils import six import webob @@ -29,12 +30,10 @@ from manila.api import xmlutil from manila import exception from manila.i18n import _ from manila.i18n import _LI -from manila.openstack.common import log as logging from manila import share from manila.share import volume_types - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) def make_share(elem): diff --git a/manila/compute/nova.py b/manila/compute/nova.py index 52126b19c8..7045fb0076 100644 --- a/manila/compute/nova.py +++ b/manila/compute/nova.py @@ -25,12 +25,11 @@ from novaclient.v1_1 import client as nova_client from novaclient.v1_1.contrib import assisted_volume_snapshots from novaclient.v1_1 import servers as nova_servers from oslo_config import cfg +from oslo_log import log from manila.db import base from manila import exception from manila.i18n import _ -from manila.openstack.common import log as logging - nova_opts = [ cfg.StrOpt('nova_catalog_info', @@ -67,7 +66,7 @@ nova_opts = [ CONF = cfg.CONF CONF.register_opts(nova_opts) -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) def novaclient(context): diff --git a/manila/context.py b/manila/context.py index 91cee38b07..2196814771 100644 --- a/manila/context.py +++ b/manila/context.py @@ -20,17 +20,16 @@ import copy from oslo_context import context as common_context +from oslo_log import log from oslo_utils import timeutils import six from manila.i18n import _ from manila.i18n import _LW from manila.openstack.common import local -from manila.openstack.common import log as logging from manila import policy - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class RequestContext(object): diff --git a/manila/db/migrations/alembic/versions/162a3e673105_manila_init.py b/manila/db/migrations/alembic/versions/162a3e673105_manila_init.py index 8e7d79858d..aa3a5dc9e7 100644 --- a/manila/db/migrations/alembic/versions/162a3e673105_manila_init.py +++ b/manila/db/migrations/alembic/versions/162a3e673105_manila_init.py @@ -25,14 +25,13 @@ revision = '162a3e673105' down_revision = None from alembic import op +from oslo_log import log from sqlalchemy import Boolean, Column, DateTime, ForeignKey from sqlalchemy import Integer, MetaData, String, Table, UniqueConstraint from manila.i18n import _LE -from manila.openstack.common import log as logging - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) def upgrade(): diff --git a/manila/db/sqlalchemy/api.py b/manila/db/sqlalchemy/api.py index b5835d14d2..835501913a 100644 --- a/manila/db/sqlalchemy/api.py +++ b/manila/db/sqlalchemy/api.py @@ -26,6 +26,7 @@ from oslo_config import cfg from oslo_db import exception as db_exception from oslo_db import options as db_options from oslo_db.sqlalchemy import session +from oslo_log import log from oslo_utils import timeutils import six from sqlalchemy import or_ @@ -39,12 +40,11 @@ from manila import exception from manila.i18n import _ from manila.i18n import _LE from manila.i18n import _LW -from manila.openstack.common import log as logging CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) _DEFAULT_QUOTA_NAME = 'default' PER_PROJECT_QUOTAS = [] diff --git a/manila/exception.py b/manila/exception.py index 145b079597..b2e7c0c322 100644 --- a/manila/exception.py +++ b/manila/exception.py @@ -24,14 +24,14 @@ SHOULD include dedicated exception logging. from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log import six import webob.exc from manila.i18n import _ from manila.i18n import _LE -from manila.openstack.common import log as logging -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) exc_log_opts = [ cfg.BoolOpt('fatal_exception_format_errors', diff --git a/manila/manager.py b/manila/manager.py index c196305d29..bb5781c6b1 100644 --- a/manila/manager.py +++ b/manila/manager.py @@ -52,18 +52,16 @@ This module provides Manager, a base class for managers. """ from oslo_config import cfg +from oslo_log import log import six from manila.db import base from manila.i18n import _LE -from manila.openstack.common import log as logging from manila.scheduler import rpcapi as scheduler_rpcapi from manila import version CONF = cfg.CONF - - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) def periodic_task(*args, **kwargs): diff --git a/manila/network/linux/interface.py b/manila/network/linux/interface.py index e14a1c2b7a..f1ec2145d8 100644 --- a/manila/network/linux/interface.py +++ b/manila/network/linux/interface.py @@ -17,6 +17,7 @@ import abc import netaddr from oslo_config import cfg +from oslo_log import log import six from manila import exception @@ -25,11 +26,10 @@ from manila.i18n import _LE from manila.i18n import _LW from manila.network.linux import ip_lib from manila.network.linux import ovs_lib -from manila.openstack.common import log as logging from manila import utils -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) OPTS = [ cfg.StrOpt('ovs_integration_bridge', diff --git a/manila/network/linux/ovs_lib.py b/manila/network/linux/ovs_lib.py index 2e6cb82b4d..3e436e9789 100644 --- a/manila/network/linux/ovs_lib.py +++ b/manila/network/linux/ovs_lib.py @@ -15,11 +15,12 @@ import re +from oslo_log import log + from manila.i18n import _LE -from manila.openstack.common import log as logging from manila import utils -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class OVSBridge: diff --git a/manila/network/neutron/api.py b/manila/network/neutron/api.py index c0782b169e..586dde3fda 100644 --- a/manila/network/neutron/api.py +++ b/manila/network/neutron/api.py @@ -17,13 +17,13 @@ from neutronclient.common import exceptions as neutron_client_exc from neutronclient.v2_0 import client as clientv20 from oslo_config import cfg +from oslo_log import log from manila import context from manila.db import base from manila import exception from manila.i18n import _LE from manila.network.neutron import constants as neutron_constants -from manila.openstack.common import log as logging neutron_opts = [ cfg.StrOpt( @@ -74,7 +74,7 @@ neutron_opts = [ ] CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class API(base.Base): diff --git a/manila/network/neutron/neutron_network_plugin.py b/manila/network/neutron/neutron_network_plugin.py index 1cf7dcfe68..89f9a3f5f1 100644 --- a/manila/network/neutron/neutron_network_plugin.py +++ b/manila/network/neutron/neutron_network_plugin.py @@ -15,13 +15,13 @@ # under the License. from oslo_config import cfg +from oslo_log import log from manila.common import constants from manila import exception from manila import network from manila.network.neutron import api as neutron_api from manila.network.neutron import constants as neutron_constants -from manila.openstack.common import log as logging neutron_single_network_plugin_opts = [ cfg.StrOpt( @@ -40,7 +40,7 @@ neutron_single_network_plugin_opts = [ ] CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class NeutronNetworkPlugin(network.NetworkBaseAPI): diff --git a/manila/opts.py b/manila/opts.py index 4023d3079a..f739254b62 100644 --- a/manila/opts.py +++ b/manila/opts.py @@ -21,6 +21,7 @@ import copy import itertools import oslo_concurrency.opts +import oslo_log._options import manila.api.middleware.auth import manila.api.middleware.sizelimit @@ -128,6 +129,7 @@ _opts = [ ] _opts.extend(oslo_concurrency.opts.list_opts()) +_opts.extend(oslo_log._options.list_opts()) def list_opts(): diff --git a/manila/quota.py b/manila/quota.py index 98d0135505..d61ce93971 100644 --- a/manila/quota.py +++ b/manila/quota.py @@ -19,6 +19,7 @@ import datetime from oslo_config import cfg +from oslo_log import log from oslo_utils import importutils from oslo_utils import timeutils import six @@ -26,9 +27,8 @@ import six from manila import db from manila import exception from manila.i18n import _LE -from manila.openstack.common import log as logging -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) quota_opts = [ cfg.IntOpt('quota_shares', diff --git a/manila/scheduler/filter_scheduler.py b/manila/scheduler/filter_scheduler.py index 6c3f7ee1b2..14146ae9f1 100644 --- a/manila/scheduler/filter_scheduler.py +++ b/manila/scheduler/filter_scheduler.py @@ -21,16 +21,16 @@ Weighing Functions. """ from oslo_config import cfg +from oslo_log import log from manila import exception from manila.i18n import _ from manila.i18n import _LE -from manila.openstack.common import log as logging from manila.scheduler import driver from manila.scheduler import scheduler_options CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class FilterScheduler(driver.Scheduler): diff --git a/manila/scheduler/filters/capacity_filter.py b/manila/scheduler/filters/capacity_filter.py index 6364e5935e..85e7eea1d8 100644 --- a/manila/scheduler/filters/capacity_filter.py +++ b/manila/scheduler/filters/capacity_filter.py @@ -18,13 +18,13 @@ import math +from oslo_log import log + from manila.i18n import _LE from manila.i18n import _LW -from manila.openstack.common import log as logging from manila.openstack.common.scheduler import filters - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class CapacityFilter(filters.BaseHostFilter): diff --git a/manila/scheduler/filters/retry_filter.py b/manila/scheduler/filters/retry_filter.py index 28256c433a..a07643229e 100644 --- a/manila/scheduler/filters/retry_filter.py +++ b/manila/scheduler/filters/retry_filter.py @@ -13,10 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from manila.openstack.common import log as logging +from oslo_log import log + from manila.openstack.common.scheduler import filters -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class RetryFilter(filters.BaseHostFilter): diff --git a/manila/scheduler/host_manager.py b/manila/scheduler/host_manager.py index 92e506841d..29751540e2 100644 --- a/manila/scheduler/host_manager.py +++ b/manila/scheduler/host_manager.py @@ -21,13 +21,13 @@ Manage hosts in the current zone. import UserDict from oslo_config import cfg +from oslo_log import log from oslo_utils import timeutils import six from manila import db from manila import exception from manila.i18n import _LI -from manila.openstack.common import log as logging from manila.openstack.common.scheduler import filters from manila.openstack.common.scheduler import weights from manila.share import utils as share_utils @@ -52,7 +52,7 @@ host_manager_opts = [ CONF = cfg.CONF CONF.register_opts(host_manager_opts) -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class ReadOnlyDict(UserDict.IterableUserDict): diff --git a/manila/scheduler/manager.py b/manila/scheduler/manager.py index f06cce05d6..075066f8c1 100644 --- a/manila/scheduler/manager.py +++ b/manila/scheduler/manager.py @@ -21,6 +21,7 @@ Scheduler Service from oslo import messaging from oslo_config import cfg +from oslo_log import log from oslo_utils import excutils from oslo_utils import importutils @@ -29,11 +30,10 @@ from manila import db from manila import exception from manila.i18n import _LW from manila import manager -from manila.openstack.common import log as logging from manila import rpc from manila.share import rpcapi as share_rpcapi -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) scheduler_driver_opt = cfg.StrOpt('scheduler_driver', default='manila.scheduler.filter_scheduler.' diff --git a/manila/scheduler/scheduler_options.py b/manila/scheduler/scheduler_options.py index 37862a95fd..c39125e697 100644 --- a/manila/scheduler/scheduler_options.py +++ b/manila/scheduler/scheduler_options.py @@ -24,11 +24,11 @@ import datetime import os from oslo_config import cfg +from oslo_log import log from oslo_serialization import jsonutils from oslo_utils import timeutils from manila.i18n import _LE -from manila.openstack.common import log as logging scheduler_json_config_location_opt = cfg.StrOpt( 'scheduler_json_config_location', @@ -38,7 +38,7 @@ scheduler_json_config_location_opt = cfg.StrOpt( CONF = cfg.CONF CONF.register_opt(scheduler_json_config_location_opt) -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class SchedulerOptions(object): diff --git a/manila/service.py b/manila/service.py index 34cedae613..8da9c8803e 100644 --- a/manila/service.py +++ b/manila/service.py @@ -29,6 +29,7 @@ import eventlet import greenlet from oslo import messaging from oslo_config import cfg +from oslo_log import log from oslo_utils import importutils from manila import context @@ -37,13 +38,12 @@ from manila import exception from manila.i18n import _LE from manila.i18n import _LI from manila.i18n import _LW -from manila.openstack.common import log as logging from manila.openstack.common import loopingcall from manila import rpc from manila import version from manila import wsgi -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) service_opts = [ cfg.IntOpt('report_interval', diff --git a/manila/share/api.py b/manila/share/api.py index 28e077f1a9..a52704f476 100644 --- a/manila/share/api.py +++ b/manila/share/api.py @@ -19,6 +19,7 @@ Handles all requests relating to shares. """ from oslo_config import cfg +from oslo_log import log from oslo_utils import excutils from oslo_utils import timeutils import six @@ -30,7 +31,6 @@ from manila import exception from manila.i18n import _ from manila.i18n import _LE from manila.i18n import _LW -from manila.openstack.common import log as logging from manila import policy from manila import quota from manila.scheduler import rpcapi as scheduler_rpcapi @@ -47,7 +47,7 @@ share_api_opts = [ CONF = cfg.CONF CONF.register_opts(share_api_opts) -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) GB = 1048576 * 1024 QUOTAS = quota.QUOTAS diff --git a/manila/share/configuration.py b/manila/share/configuration.py index 1770576660..a8d1810566 100644 --- a/manila/share/configuration.py +++ b/manila/share/configuration.py @@ -43,12 +43,10 @@ and registered in the group in which they are used. """ from oslo_config import cfg - -from manila.openstack.common import log as logging - +from oslo_log import log CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class Configuration(object): diff --git a/manila/share/driver.py b/manila/share/driver.py index e8556274b7..05ed18d93a 100644 --- a/manila/share/driver.py +++ b/manila/share/driver.py @@ -21,14 +21,14 @@ Drivers for shares. import time from oslo_config import cfg +from oslo_log import log from manila import exception from manila.i18n import _LE from manila import network -from manila.openstack.common import log as logging from manila import utils -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) share_opts = [ # NOTE(rushiagr): Reasonable to define this option at only one place. diff --git a/manila/share/drivers/emc/driver.py b/manila/share/drivers/emc/driver.py index 38364f0554..25967cfee9 100644 --- a/manila/share/drivers/emc/driver.py +++ b/manila/share/drivers/emc/driver.py @@ -21,8 +21,8 @@ to specify, which backend plugins to use. """ from oslo_config import cfg +from oslo_log import log -from manila.openstack.common import log from manila.share import driver from manila.share.drivers.emc import plugin_manager as manager diff --git a/manila/share/drivers/emc/plugins/vnx/connection.py b/manila/share/drivers/emc/plugins/vnx/connection.py index 5084f8fb0d..075bc220b5 100644 --- a/manila/share/drivers/emc/plugins/vnx/connection.py +++ b/manila/share/drivers/emc/plugins/vnx/connection.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. """VNX backend for the EMC Manila driver.""" +from oslo_log import log from oslo_utils import excutils from oslo_utils import units import six @@ -22,7 +23,6 @@ from manila import exception from manila.i18n import _ from manila.i18n import _LE from manila.i18n import _LW -from manila.openstack.common import log from manila.share.drivers.emc.plugins import base as driver from manila.share.drivers.emc.plugins.vnx import constants from manila.share.drivers.emc.plugins.vnx import helper diff --git a/manila/share/drivers/emc/plugins/vnx/helper.py b/manila/share/drivers/emc/plugins/vnx/helper.py index 4cb1139414..22bd8b53ea 100644 --- a/manila/share/drivers/emc/plugins/vnx/helper.py +++ b/manila/share/drivers/emc/plugins/vnx/helper.py @@ -17,6 +17,7 @@ import random import re from eventlet import greenthread +from oslo_log import log import six from six.moves.urllib import error as url_error # pylint: disable=E0611 from six.moves.urllib import request as url_request # pylint: disable=E0611 @@ -26,15 +27,13 @@ from manila.i18n import _ from manila.i18n import _LE from manila.i18n import _LI from manila.i18n import _LW -from manila.openstack.common import log as logging from manila.share.drivers.emc.plugins.vnx import constants from manila.share.drivers.emc.plugins.vnx import utils as vnx_utils from manila.share.drivers.emc.plugins.vnx import xml_api_parser as parser from manila.share.drivers.emc.plugins.vnx import xml_api_schema as schema from manila import utils - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class XMLAPIConnector(object): diff --git a/manila/share/drivers/emc/plugins/vnx/utils.py b/manila/share/drivers/emc/plugins/vnx/utils.py index b4a9dd1215..981eac6ace 100644 --- a/manila/share/drivers/emc/plugins/vnx/utils.py +++ b/manila/share/drivers/emc/plugins/vnx/utils.py @@ -15,11 +15,9 @@ import types from oslo_config import cfg +from oslo_log import log from oslo_utils import timeutils -from manila.openstack.common import log - - CONF = cfg.CONF LOG = log.getLogger(__name__) diff --git a/manila/share/drivers/emc/plugins/vnx/xml_api_parser.py b/manila/share/drivers/emc/plugins/vnx/xml_api_parser.py index be159ff863..c386f757f5 100644 --- a/manila/share/drivers/emc/plugins/vnx/xml_api_parser.py +++ b/manila/share/drivers/emc/plugins/vnx/xml_api_parser.py @@ -15,9 +15,9 @@ import types import xml.dom.minidom -from manila.i18n import _LW -from manila.openstack.common import log +from oslo_log import log +from manila.i18n import _LW LOG = log.getLogger(__name__) diff --git a/manila/share/drivers/ganesha/__init__.py b/manila/share/drivers/ganesha/__init__.py index cfc1f8dc94..cf8a643042 100644 --- a/manila/share/drivers/ganesha/__init__.py +++ b/manila/share/drivers/ganesha/__init__.py @@ -19,17 +19,16 @@ import os import re from oslo_config import cfg +from oslo_log import log import six from manila import exception from manila.i18n import _LI -from manila.openstack.common import log as logging from manila.share.drivers.ganesha import manager as ganesha_manager from manila.share.drivers.ganesha import utils as ganesha_utils - CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) @six.add_metaclass(abc.ABCMeta) diff --git a/manila/share/drivers/ganesha/manager.py b/manila/share/drivers/ganesha/manager.py index d00556a651..53c59afe67 100644 --- a/manila/share/drivers/ganesha/manager.py +++ b/manila/share/drivers/ganesha/manager.py @@ -18,18 +18,17 @@ import pipes import re import sys +from oslo_log import log from oslo_serialization import jsonutils import six from manila import exception from manila.i18n import _ from manila.i18n import _LE -from manila.openstack.common import log as logging from manila.share.drivers.ganesha import utils as ganesha_utils from manila import utils - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) IWIDTH = 4 diff --git a/manila/share/drivers/generic.py b/manila/share/drivers/generic.py index 5558fac130..17c2730756 100644 --- a/manila/share/drivers/generic.py +++ b/manila/share/drivers/generic.py @@ -21,6 +21,7 @@ import time from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log from oslo_utils import excutils from oslo_utils import importutils import six @@ -32,14 +33,12 @@ from manila import exception from manila.i18n import _ from manila.i18n import _LE from manila.i18n import _LW -from manila.openstack.common import log as logging from manila.share import driver from manila.share.drivers import service_instance from manila import utils from manila import volume - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) share_opts = [ cfg.StrOpt('smb_template_config_path', diff --git a/manila/share/drivers/glusterfs.py b/manila/share/drivers/glusterfs.py index 64bb93b43b..136bc70709 100644 --- a/manila/share/drivers/glusterfs.py +++ b/manila/share/drivers/glusterfs.py @@ -30,19 +30,18 @@ import sys import xml.etree.cElementTree as etree from oslo_config import cfg +from oslo_log import log import six from manila import exception from manila.i18n import _ from manila.i18n import _LE from manila.i18n import _LW -from manila.openstack.common import log as logging from manila.share import driver from manila.share.drivers import ganesha from manila.share.drivers.ganesha import utils as ganesha_utils - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) GlusterfsManilaShare_opts = [ cfg.StrOpt('glusterfs_target', diff --git a/manila/share/drivers/glusterfs_native.py b/manila/share/drivers/glusterfs_native.py index a0ee94cb30..8cbc997f5d 100644 --- a/manila/share/drivers/glusterfs_native.py +++ b/manila/share/drivers/glusterfs_native.py @@ -31,18 +31,17 @@ import shutil import tempfile from oslo_config import cfg +from oslo_log import log import six from manila import exception from manila.i18n import _ from manila.i18n import _LI -from manila.openstack.common import log as logging from manila.share import driver from manila.share.drivers import glusterfs from manila import utils - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) glusterfs_native_manila_share_opts = [ cfg.ListOpt('glusterfs_targets', diff --git a/manila/share/drivers/hds/sop.py b/manila/share/drivers/hds/sop.py index 12832b0554..a87f57c5a4 100644 --- a/manila/share/drivers/hds/sop.py +++ b/manila/share/drivers/hds/sop.py @@ -23,17 +23,16 @@ import time import httplib2 from oslo_config import cfg +from oslo_log import log from oslo_serialization import jsonutils as json from oslo_utils import units import six from manila import exception from manila.i18n import _LW -from manila.openstack.common import log as logging from manila.share import driver - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) hdssop_share_opts = [ cfg.StrOpt('hdssop_target', diff --git a/manila/share/drivers/huawei/huawei_helper.py b/manila/share/drivers/huawei/huawei_helper.py index b58fad1348..0df0fd1e6a 100644 --- a/manila/share/drivers/huawei/huawei_helper.py +++ b/manila/share/drivers/huawei/huawei_helper.py @@ -16,6 +16,7 @@ import base64 from xml import etree +from oslo_log import log from oslo_serialization import jsonutils from oslo_utils import units import six @@ -24,11 +25,10 @@ from six.moves.urllib import request as urlreq # pylint: disable=E0611 from manila import exception from manila.i18n import _, _LE, _LW -from manila.openstack.common import log as logging from manila.share.drivers.huawei import constants from manila import utils -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class RestHelper(): diff --git a/manila/share/drivers/huawei/huawei_nas.py b/manila/share/drivers/huawei/huawei_nas.py index 586228d98a..5e2a6918c1 100644 --- a/manila/share/drivers/huawei/huawei_nas.py +++ b/manila/share/drivers/huawei/huawei_nas.py @@ -17,12 +17,12 @@ import time from oslo_config import cfg +from oslo_log import log from oslo_utils import excutils from oslo_utils import units from manila import exception from manila.i18n import _, _LI, _LW -from manila.openstack.common import log as logging from manila.openstack.common import loopingcall from manila.share import driver from manila.share.drivers.huawei import constants @@ -35,7 +35,7 @@ huawei_opts = [ CONF = cfg.CONF CONF.register_opts(huawei_opts) -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class HuaweiNasDriver(driver.ShareDriver): diff --git a/manila/share/drivers/ibm/ganesha_utils.py b/manila/share/drivers/ibm/ganesha_utils.py index bb951a4b32..00d24b1030 100644 --- a/manila/share/drivers/ibm/ganesha_utils.py +++ b/manila/share/drivers/ibm/ganesha_utils.py @@ -30,14 +30,14 @@ import socket import time import netaddr +from oslo_log import log import six from manila import exception from manila.i18n import _, _LI -from manila.openstack.common import log as logging from manila import utils -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) # more simple pattern for matching a single avpair per line, # skips lines starting with # comment char AVPATTERN = re.compile('^\s*(?!#)\s*(?P\S+)\s*=\s*(?P\S+)\s*;') diff --git a/manila/share/drivers/ibm/gpfs.py b/manila/share/drivers/ibm/gpfs.py index 29a42932a5..0bc13bc6d1 100644 --- a/manila/share/drivers/ibm/gpfs.py +++ b/manila/share/drivers/ibm/gpfs.py @@ -38,6 +38,7 @@ import socket from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log from oslo_utils import excutils from oslo_utils import importutils from oslo_utils import units @@ -45,12 +46,11 @@ import six from manila import exception from manila.i18n import _, _LE, _LI -from manila.openstack.common import log as logging from manila.share import driver from manila.share.drivers.ibm import ganesha_utils from manila import utils -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) # matches multiple comma separated avpairs on a line. values with an embedded # comma must be wrapped in quotation marks diff --git a/manila/share/drivers/netapp/api.py b/manila/share/drivers/netapp/api.py index 50cfc99ad7..1c7ad8d42a 100644 --- a/manila/share/drivers/netapp/api.py +++ b/manila/share/drivers/netapp/api.py @@ -21,9 +21,9 @@ Contains classes required to issue api calls to ONTAP and OnCommand DFM. import urllib2 from lxml import etree +from oslo_log import log from manila.i18n import _ -from manila.openstack.common import log LOG = log.getLogger(__name__) diff --git a/manila/share/drivers/netapp/cluster_mode.py b/manila/share/drivers/netapp/cluster_mode.py index c3899da4cd..4f57aa0b22 100644 --- a/manila/share/drivers/netapp/cluster_mode.py +++ b/manila/share/drivers/netapp/cluster_mode.py @@ -25,6 +25,7 @@ import hashlib import re from oslo_config import cfg +from oslo_log import log from oslo_utils import excutils from oslo_utils import units import six @@ -34,7 +35,6 @@ from manila import exception from manila.i18n import _ from manila.i18n import _LE from manila.i18n import _LI -from manila.openstack.common import log from manila.share import driver from manila.share.drivers.netapp import api as naapi from manila.share.drivers.netapp import utils as na_utils diff --git a/manila/share/drivers/netapp/common.py b/manila/share/drivers/netapp/common.py index de16677a2a..b93980e152 100644 --- a/manila/share/drivers/netapp/common.py +++ b/manila/share/drivers/netapp/common.py @@ -17,17 +17,16 @@ Unified driver for NetApp storage systems. Supports multiple storage systems of different families and driver modes. """ +from oslo_log import log from oslo_utils import importutils from manila import exception from manila.i18n import _, _LI -from manila.openstack.common import log as logging from manila.share import driver from manila.share.drivers.netapp import cluster_mode from manila.share.drivers.netapp import utils as na_utils - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) # Add new drivers here, no other code changes required. NETAPP_UNIFIED_DRIVER_REGISTRY = { diff --git a/manila/share/drivers/netapp/utils.py b/manila/share/drivers/netapp/utils.py index 31cc06ab90..913d6bd638 100644 --- a/manila/share/drivers/netapp/utils.py +++ b/manila/share/drivers/netapp/utils.py @@ -20,16 +20,15 @@ import platform import socket from oslo_concurrency import processutils as putils +from oslo_log import log from oslo_utils import timeutils from manila import exception from manila.i18n import _, _LI, _LW -from manila.openstack.common import log as logging from manila.share.drivers.netapp import api as na_api from manila import version - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) VALID_TRACE_FLAGS = ['method', 'api'] diff --git a/manila/share/drivers/service_instance.py b/manila/share/drivers/service_instance.py index e23f45133a..d3646c755e 100644 --- a/manila/share/drivers/service_instance.py +++ b/manila/share/drivers/service_instance.py @@ -23,6 +23,7 @@ import time import netaddr from oslo_config import cfg +from oslo_log import log from oslo_utils import importutils import six @@ -34,11 +35,9 @@ from manila.i18n import _ from manila.i18n import _LW from manila.network.linux import ip_lib from manila.network.neutron import api as neutron -from manila.openstack.common import log as logging from manila import utils - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) share_servers_handling_mode_opts = [ cfg.StrOpt('service_image_name', diff --git a/manila/share/drivers/zfssa/zfssarest.py b/manila/share/drivers/zfssa/zfssarest.py index e97957fd48..30c6eea532 100644 --- a/manila/share/drivers/zfssa/zfssarest.py +++ b/manila/share/drivers/zfssa/zfssarest.py @@ -14,12 +14,12 @@ """ ZFS Storage Appliance Proxy """ +from oslo_log import log from oslo_serialization import jsonutils from manila import exception from manila.i18n import _ from manila.i18n import _LE -from manila.openstack.common import log from manila.share.drivers.zfssa import restclient diff --git a/manila/share/drivers/zfssa/zfssashare.py b/manila/share/drivers/zfssa/zfssashare.py index b6d08d2a07..1eb574f47d 100644 --- a/manila/share/drivers/zfssa/zfssashare.py +++ b/manila/share/drivers/zfssa/zfssashare.py @@ -18,12 +18,12 @@ ZFS Storage Appliance Manila Share Driver import base64 from oslo_config import cfg +from oslo_log import log from oslo_utils import units from manila import exception from manila.i18n import _ from manila.i18n import _LE -from manila.openstack.common import log from manila.share import driver from manila.share.drivers.zfssa import zfssarest diff --git a/manila/share/manager.py b/manila/share/manager.py index 5bacfd0f0f..7ffc619b55 100644 --- a/manila/share/manager.py +++ b/manila/share/manager.py @@ -20,6 +20,7 @@ """ from oslo_config import cfg +from oslo_log import log from oslo_utils import excutils from oslo_utils import importutils from oslo_utils import timeutils @@ -32,13 +33,12 @@ from manila.i18n import _LE from manila.i18n import _LI from manila.i18n import _LW from manila import manager -from manila.openstack.common import log as logging from manila import quota import manila.share.configuration from manila.share import utils as share_utils from manila import utils -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) share_manager_opts = [ cfg.StrOpt('share_driver', diff --git a/manila/share/volume_types.py b/manila/share/volume_types.py index 7865c73dec..0393b6970c 100644 --- a/manila/share/volume_types.py +++ b/manila/share/volume_types.py @@ -17,6 +17,7 @@ from oslo_config import cfg from oslo_db import exception as db_exception +from oslo_log import log import six from manila import context @@ -24,10 +25,9 @@ from manila import db from manila import exception from manila.i18n import _ from manila.i18n import _LE -from manila.openstack.common import log as logging CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) def create(context, name, extra_specs={}): diff --git a/manila/test.py b/manila/test.py index eeb1e02929..da85d99c2e 100644 --- a/manila/test.py +++ b/manila/test.py @@ -31,13 +31,13 @@ from oslo.messaging import conffixture as messaging_conffixture from oslo_concurrency import lockutils from oslo_config import cfg from oslo_config import fixture as config_fixture +from oslo_log import log import oslotest.base as base_test import six from manila.db import migration from manila.db.sqlalchemy import api as db_api from manila.db.sqlalchemy import models as db_models -from manila.openstack.common import log as logging from manila import rpc from manila import service from manila.tests import conf_fixture @@ -52,7 +52,7 @@ test_opts = [ CONF = cfg.CONF CONF.register_opts(test_opts) -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) _DB_CACHE = None diff --git a/manila/tests/api/test_router.py b/manila/tests/api/test_router.py index 5c17b47333..09b6a6d516 100644 --- a/manila/tests/api/test_router.py +++ b/manila/tests/api/test_router.py @@ -14,17 +14,17 @@ # under the License. from oslo_config import cfg +from oslo_log import log from manila.api.openstack import wsgi from manila.api.v1 import router from manila.api import versions -from manila.openstack.common import log as logging from manila import test from manila.tests.api import fakes CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class FakeController(object): diff --git a/manila/tests/db/migrations/alembic/test_migration.py b/manila/tests/db/migrations/alembic/test_migration.py index 5c3fa4bb2f..bc61949187 100644 --- a/manila/tests/db/migrations/alembic/test_migration.py +++ b/manila/tests/db/migrations/alembic/test_migration.py @@ -21,12 +21,12 @@ from alembic import script import mock from oslo_db.sqlalchemy import test_base from oslo_db.sqlalchemy import test_migrations +from oslo_log import log from sqlalchemy.sql import text from manila.db.migrations.alembic import migration -from manila.openstack.common import log as logging -LOG = logging.getLogger('manila.tests.test_migrations') +LOG = log.getLogger('manila.tests.test_migrations') class ManilaMigrationsCheckers(test_migrations.WalkVersionsMixin): diff --git a/manila/tests/fake_compute.py b/manila/tests/fake_compute.py index b4f9931318..fdf14ff299 100644 --- a/manila/tests/fake_compute.py +++ b/manila/tests/fake_compute.py @@ -15,12 +15,10 @@ from oslo_config import cfg - -from manila.openstack.common import log as logging - +from oslo_log import log CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class FakeServer(object): diff --git a/manila/tests/fake_driver.py b/manila/tests/fake_driver.py index 94b5a96db0..249748bb0f 100644 --- a/manila/tests/fake_driver.py +++ b/manila/tests/fake_driver.py @@ -14,11 +14,11 @@ # under the License. import mock +from oslo_log import log -from manila.openstack.common import log as logging from manila.share import driver -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class FakeShareDriver(driver.ShareDriver): diff --git a/manila/tests/fake_network.py b/manila/tests/fake_network.py index 6ede2b668d..50ff5cbfed 100644 --- a/manila/tests/fake_network.py +++ b/manila/tests/fake_network.py @@ -16,12 +16,10 @@ import uuid from oslo_config import cfg - -from manila.openstack.common import log as logging - +from oslo_log import log CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class FakeNetwork(object): diff --git a/manila/tests/fake_service_instance.py b/manila/tests/fake_service_instance.py index 0b94ea3199..9ef8747535 100644 --- a/manila/tests/fake_service_instance.py +++ b/manila/tests/fake_service_instance.py @@ -13,11 +13,11 @@ # under the License. import mock +from oslo_log import log -from manila.openstack.common import log as logging from manila.tests import fake_compute -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class FakeServiceInstanceManager(object): diff --git a/manila/tests/fake_utils.py b/manila/tests/fake_utils.py index b8b8825605..b56d49cbfc 100644 --- a/manila/tests/fake_utils.py +++ b/manila/tests/fake_utils.py @@ -17,13 +17,13 @@ import re from eventlet import greenthread +from oslo_log import log import six from manila import exception -from manila.openstack.common import log as logging from manila import utils -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) _fake_execute_repliers = [] _fake_execute_log = [] diff --git a/manila/tests/fake_volume.py b/manila/tests/fake_volume.py index 375b6f73a3..86868ab3f2 100644 --- a/manila/tests/fake_volume.py +++ b/manila/tests/fake_volume.py @@ -15,12 +15,10 @@ from oslo_config import cfg - -from manila.openstack.common import log as logging - +from oslo_log import log CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class FakeVolume(object): diff --git a/manila/tests/integrated/api/client.py b/manila/tests/integrated/api/client.py index f68d2d3a34..99844025b4 100644 --- a/manila/tests/integrated/api/client.py +++ b/manila/tests/integrated/api/client.py @@ -14,13 +14,11 @@ import httplib +from oslo_log import log from oslo_serialization import jsonutils from six.moves.urllib import parse -from manila.openstack.common import log as logging - - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class OpenStackApiException(Exception): diff --git a/manila/tests/integrated/integrated_helpers.py b/manila/tests/integrated/integrated_helpers.py index d3a0151e3b..0f9e6d9d27 100644 --- a/manila/tests/integrated/integrated_helpers.py +++ b/manila/tests/integrated/integrated_helpers.py @@ -21,8 +21,8 @@ import random import string import uuid +from oslo_log import log -from manila.openstack.common import log as logging from manila import service from manila import test # For the flags from manila.tests.integrated.api import client @@ -30,7 +30,7 @@ from manila.tests.integrated.api import client from oslo_config import cfg CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) def generate_random_alphanumeric(length): diff --git a/manila/tests/integrated/test_extensions.py b/manila/tests/integrated/test_extensions.py index 37c74e96bb..623e13ba07 100644 --- a/manila/tests/integrated/test_extensions.py +++ b/manila/tests/integrated/test_extensions.py @@ -14,13 +14,12 @@ # under the License. from oslo_config import cfg +from oslo_log import log -from manila.openstack.common import log as logging from manila.tests.integrated import integrated_helpers - CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class ExtensionsTest(integrated_helpers._IntegratedTestBase): diff --git a/manila/tests/integrated/test_login.py b/manila/tests/integrated/test_login.py index ad9115574f..da360da025 100644 --- a/manila/tests/integrated/test_login.py +++ b/manila/tests/integrated/test_login.py @@ -13,11 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. -from manila.openstack.common import log as logging +from oslo_log import log + from manila.tests.integrated import integrated_helpers - -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class LoginTest(integrated_helpers._IntegratedTestBase): diff --git a/manila/tests/share/drivers/emc/test_driver.py b/manila/tests/share/drivers/emc/test_driver.py index 7309e39403..041974efd9 100644 --- a/manila/tests/share/drivers/emc/test_driver.py +++ b/manila/tests/share/drivers/emc/test_driver.py @@ -14,15 +14,15 @@ # under the License. import mock +from oslo_log import log from stevedore import extension -from manila.openstack.common import log as logging from manila.share import configuration as conf from manila.share.drivers.emc import driver as emcdriver from manila.share.drivers.emc.plugins import base from manila import test -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class FakeConnection(base.StorageConnection): diff --git a/manila/tests/share/drivers/emc/test_emc_vnx.py b/manila/tests/share/drivers/emc/test_emc_vnx.py index b926af6bd4..a7db05a0a5 100644 --- a/manila/tests/share/drivers/emc/test_emc_vnx.py +++ b/manila/tests/share/drivers/emc/test_emc_vnx.py @@ -14,18 +14,18 @@ # under the License. import ddt import mock +from oslo_log import log from oslo_utils import units import manila.db from manila import exception -from manila.openstack.common import log as logging from manila.share import configuration as conf from manila.share.drivers.emc import driver as emc_driver from manila.share.drivers.emc.plugins.vnx import helper from manila import test from manila.tests import fake_share -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) def query(func): diff --git a/manila/tests/share/drivers/zfssa/test_zfssarest.py b/manila/tests/share/drivers/zfssa/test_zfssarest.py index feb754e4fd..9bb3717117 100644 --- a/manila/tests/share/drivers/zfssa/test_zfssarest.py +++ b/manila/tests/share/drivers/zfssa/test_zfssarest.py @@ -15,9 +15,9 @@ Unit tests for Oracle's ZFSSA REST API. """ import mock +from oslo_log import log from manila import exception -from manila.openstack.common import log from manila.share.drivers.zfssa import restclient from manila.share.drivers.zfssa import zfssarest from manila import test diff --git a/manila/utils.py b/manila/utils.py index 5c2f2fb698..9eadb3f253 100644 --- a/manila/utils.py +++ b/manila/utils.py @@ -36,6 +36,7 @@ import netaddr from oslo_concurrency import lockutils from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log from oslo_utils import importutils from oslo_utils import timeutils import paramiko @@ -43,11 +44,9 @@ import six from manila import exception from manila.i18n import _ -from manila.openstack.common import log as logging - CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) synchronized = lockutils.synchronized_with_prefix('manila-') diff --git a/manila/volume/cinder.py b/manila/volume/cinder.py index d0bff57dde..f9c671da0d 100644 --- a/manila/volume/cinder.py +++ b/manila/volume/cinder.py @@ -24,11 +24,11 @@ from cinderclient import exceptions as cinder_exception from cinderclient import service_catalog from cinderclient.v2 import client as cinder_client from oslo_config import cfg +from oslo_log import log from manila.db import base from manila import exception from manila.i18n import _ -from manila.openstack.common import log as logging cinder_opts = [ @@ -68,7 +68,7 @@ cinder_opts = [ CONF = cfg.CONF CONF.register_opts(cinder_opts) -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) def cinderclient(context): diff --git a/manila/wsgi.py b/manila/wsgi.py index e9af441c39..d3b08f24ba 100644 --- a/manila/wsgi.py +++ b/manila/wsgi.py @@ -30,6 +30,8 @@ import eventlet import eventlet.wsgi import greenlet from oslo_config import cfg +from oslo_log import log +from oslo_log import loggers from oslo_utils import netutils from paste import deploy import routes.middleware @@ -40,7 +42,6 @@ import webob.exc from manila import exception from manila.i18n import _ from manila.i18n import _LI -from manila.openstack.common import log as logging socket_opts = [ cfg.IntOpt('backlog', @@ -88,8 +89,7 @@ CONF = cfg.CONF CONF.register_opts(socket_opts) CONF.register_opts(eventlet_opts) -CONF = cfg.CONF -LOG = logging.getLogger(__name__) +LOG = log.getLogger(__name__) class Server(object): @@ -118,8 +118,8 @@ class Server(object): self._socket = None self._protocol = protocol self._pool = eventlet.GreenPool(pool_size or self.default_pool_size) - self._logger = logging.getLogger("eventlet.wsgi.server") - self._wsgi_logger = logging.WritableLogger(self._logger) + self._logger = log.getLogger("eventlet.wsgi.server") + self._wsgi_logger = loggers.WritableLogger(self._logger) def _get_socket(self, host, port, backlog): bind_addr = (host, port) diff --git a/requirements.txt b/requirements.txt index f4c3bc111f..11c5aacf2c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,6 +16,7 @@ oslo.config>=1.6.0 # Apache-2.0 oslo.context>=0.1.0 # Apache-2.0 oslo.db>=1.4.1 # Apache-2.0 oslo.i18n>=1.3.0 # Apache-2.0 +oslo.log>=0.1.0 # Apache-2.0 oslo.messaging>=1.6.0 # Apache-2.0 oslo.rootwrap>=1.5.0 # Apache-2.0 oslo.serialization>=1.2.0 # Apache-2.0