From: Ivan Kolodyazhny Date: Thu, 19 Feb 2015 16:43:42 +0000 (+0200) Subject: Use oslo.log instead of oslo-incubator X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=5980da5d889de62d6accd6cb002029f8aec4b6a2;p=openstack-build%2Fcinder-build.git Use oslo.log instead of oslo-incubator log module was removed from oslo-incubator after oslo.log released. Change-Id: I205d0625c502cb462919edc76d12091edcc21b1b Implements: blueprint port-oslo-incubator-to-oslo-log Partial-Bug: #1381563 --- diff --git a/cinder/api/__init__.py b/cinder/api/__init__.py index bf2ac7eb6..8a178ef9f 100644 --- a/cinder/api/__init__.py +++ b/cinder/api/__init__.py @@ -16,10 +16,10 @@ from oslo_config import cfg +from oslo_log import log as logging import paste.urlmap from cinder.i18n import _LW -from cinder.openstack.common import log as logging CONF = cfg.CONF diff --git a/cinder/api/common.py b/cinder/api/common.py index 41a006ee6..4434b7d01 100644 --- a/cinder/api/common.py +++ b/cinder/api/common.py @@ -19,13 +19,13 @@ import re import urllib from oslo_config import cfg +from oslo_log import log as logging import six.moves.urllib.parse as urlparse import webob from cinder.api.openstack import wsgi from cinder.api import xmlutil from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import utils diff --git a/cinder/api/contrib/__init__.py b/cinder/api/contrib/__init__.py index 140ccc5de..9c89ad909 100644 --- a/cinder/api/contrib/__init__.py +++ b/cinder/api/contrib/__init__.py @@ -20,9 +20,9 @@ It can't be called 'extensions' because that causes namespacing problems. """ from oslo_config import cfg +from oslo_log import log as logging from cinder.api import extensions -from cinder.openstack.common import log as logging CONF = cfg.CONF diff --git a/cinder/api/contrib/admin_actions.py b/cinder/api/contrib/admin_actions.py index 9604483d3..aee4ce109 100644 --- a/cinder/api/contrib/admin_actions.py +++ b/cinder/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 as logging from oslo_utils import strutils import webob from webob import exc @@ -22,7 +23,6 @@ from cinder import backup from cinder import db from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import rpc from cinder import volume diff --git a/cinder/api/contrib/backups.py b/cinder/api/contrib/backups.py index f53569c2f..5d0ffdde5 100644 --- a/cinder/api/contrib/backups.py +++ b/cinder/api/contrib/backups.py @@ -17,7 +17,7 @@ """The backups api.""" - +from oslo_log import log as logging import webob from webob import exc @@ -29,7 +29,6 @@ from cinder.api import xmlutil from cinder import backup as backupAPI from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder import utils LOG = logging.getLogger(__name__) diff --git a/cinder/api/contrib/cgsnapshots.py b/cinder/api/contrib/cgsnapshots.py index 36d54701b..77bd046b7 100644 --- a/cinder/api/contrib/cgsnapshots.py +++ b/cinder/api/contrib/cgsnapshots.py @@ -15,7 +15,7 @@ """The cgsnapshots api.""" - +from oslo_log import log as logging import webob from webob import exc @@ -27,7 +27,6 @@ from cinder.api import xmlutil from cinder import consistencygroup as consistencygroupAPI from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder import utils LOG = logging.getLogger(__name__) diff --git a/cinder/api/contrib/consistencygroups.py b/cinder/api/contrib/consistencygroups.py index 6eabcc4a2..68bcaa381 100644 --- a/cinder/api/contrib/consistencygroups.py +++ b/cinder/api/contrib/consistencygroups.py @@ -15,7 +15,7 @@ """The consistencygroups api.""" - +from oslo_log import log as logging import webob from webob import exc @@ -27,7 +27,6 @@ from cinder.api import xmlutil from cinder import consistencygroup as consistencygroupAPI from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder import utils LOG = logging.getLogger(__name__) diff --git a/cinder/api/contrib/extended_snapshot_attributes.py b/cinder/api/contrib/extended_snapshot_attributes.py index 17e1e19da..8fbe1a6db 100644 --- a/cinder/api/contrib/extended_snapshot_attributes.py +++ b/cinder/api/contrib/extended_snapshot_attributes.py @@ -14,11 +14,11 @@ """The Extended Snapshot Attributes API extension.""" +from oslo_log import log as logging from cinder.api import extensions from cinder.api.openstack import wsgi from cinder.api import xmlutil -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/api/contrib/hosts.py b/cinder/api/contrib/hosts.py index 1940ab4d3..ac0df3225 100644 --- a/cinder/api/contrib/hosts.py +++ b/cinder/api/contrib/hosts.py @@ -18,6 +18,7 @@ from xml.parsers import expat from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import timeutils import webob.exc @@ -27,7 +28,6 @@ from cinder.api import xmlutil from cinder import db from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume import api as volume_api diff --git a/cinder/api/contrib/qos_specs_manage.py b/cinder/api/contrib/qos_specs_manage.py index b0224009b..bab8e1930 100644 --- a/cinder/api/contrib/qos_specs_manage.py +++ b/cinder/api/contrib/qos_specs_manage.py @@ -15,6 +15,7 @@ """The QoS specs extension""" +from oslo_log import log as logging from oslo_utils import strutils import six import webob @@ -25,7 +26,6 @@ from cinder.api.views import qos_specs as view_qos_specs from cinder.api import xmlutil from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder import rpc from cinder import utils from cinder.volume import qos_specs diff --git a/cinder/api/contrib/scheduler_hints.py b/cinder/api/contrib/scheduler_hints.py index 190772883..4d01d5105 100644 --- a/cinder/api/contrib/scheduler_hints.py +++ b/cinder/api/contrib/scheduler_hints.py @@ -12,13 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging import webob.exc from cinder.api import extensions from cinder.api.openstack import wsgi from cinder.api.v2 import volumes from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/api/contrib/scheduler_stats.py b/cinder/api/contrib/scheduler_stats.py index 3c59e19e7..96d8076cf 100644 --- a/cinder/api/contrib/scheduler_stats.py +++ b/cinder/api/contrib/scheduler_stats.py @@ -14,10 +14,11 @@ """The Scheduler Stats extension""" +from oslo_log import log as logging + from cinder.api import extensions from cinder.api.openstack import wsgi from cinder.api.views import scheduler_stats as scheduler_stats_view -from cinder.openstack.common import log as logging from cinder.scheduler import rpcapi diff --git a/cinder/api/contrib/services.py b/cinder/api/contrib/services.py index c0971bec8..915ce1f4e 100644 --- a/cinder/api/contrib/services.py +++ b/cinder/api/contrib/services.py @@ -15,6 +15,7 @@ from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import timeutils import webob.exc @@ -24,7 +25,7 @@ from cinder.api import xmlutil from cinder import db from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging +from cinder.openstack.common import versionutils from cinder import utils @@ -89,8 +90,9 @@ class ServiceController(wsgi.Controller): service = '' if 'service' in req.GET: service = req.GET['service'] - LOG.deprecated(_("Query by service parameter is deprecated. " - "Please use binary parameter instead.")) + versionutils.report_deprecated_feature(LOG, _( + "Query by service parameter is deprecated. " + "Please use binary parameter instead.")) binary = '' if 'binary' in req.GET: binary = req.GET['binary'] diff --git a/cinder/api/contrib/snapshot_actions.py b/cinder/api/contrib/snapshot_actions.py index 1b33fab4e..74bc03d21 100644 --- a/cinder/api/contrib/snapshot_actions.py +++ b/cinder/api/contrib/snapshot_actions.py @@ -12,13 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging import webob from cinder.api import extensions from cinder.api.openstack import wsgi from cinder import db from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/api/contrib/volume_actions.py b/cinder/api/contrib/volume_actions.py index 7109afe28..aca5c1184 100644 --- a/cinder/api/contrib/volume_actions.py +++ b/cinder/api/contrib/volume_actions.py @@ -13,6 +13,7 @@ # under the License. +from oslo_log import log as logging import oslo_messaging as messaging from oslo_utils import strutils import webob @@ -22,7 +23,6 @@ from cinder.api.openstack import wsgi from cinder.api import xmlutil from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import utils from cinder import volume diff --git a/cinder/api/contrib/volume_host_attribute.py b/cinder/api/contrib/volume_host_attribute.py index c54eaf003..511366295 100644 --- a/cinder/api/contrib/volume_host_attribute.py +++ b/cinder/api/contrib/volume_host_attribute.py @@ -12,10 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging + from cinder.api import extensions from cinder.api.openstack import wsgi from cinder.api import xmlutil -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/api/contrib/volume_manage.py b/cinder/api/contrib/volume_manage.py index 30ed18fd8..ca9c3b174 100644 --- a/cinder/api/contrib/volume_manage.py +++ b/cinder/api/contrib/volume_manage.py @@ -13,6 +13,7 @@ # under the License. from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import uuidutils from webob import exc @@ -22,7 +23,6 @@ from cinder.api.v2.views import volumes as volume_views from cinder.api.v2 import volumes from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import utils from cinder import volume as cinder_volume from cinder.volume import volume_types diff --git a/cinder/api/contrib/volume_replication.py b/cinder/api/contrib/volume_replication.py index 3e118692c..086efa1d3 100644 --- a/cinder/api/contrib/volume_replication.py +++ b/cinder/api/contrib/volume_replication.py @@ -12,6 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging import webob from webob import exc @@ -20,7 +21,6 @@ from cinder.api.openstack import wsgi from cinder.api import xmlutil from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder import replication as replicationAPI from cinder import volume diff --git a/cinder/api/contrib/volume_transfer.py b/cinder/api/contrib/volume_transfer.py index 833f30d87..9cc35351b 100644 --- a/cinder/api/contrib/volume_transfer.py +++ b/cinder/api/contrib/volume_transfer.py @@ -13,6 +13,7 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging import webob from webob import exc @@ -23,7 +24,6 @@ from cinder.api.views import transfers as transfer_view from cinder.api import xmlutil from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder import transfer as transferAPI from cinder import utils diff --git a/cinder/api/contrib/volume_unmanage.py b/cinder/api/contrib/volume_unmanage.py index edfaee122..a4c5ee4d2 100644 --- a/cinder/api/contrib/volume_unmanage.py +++ b/cinder/api/contrib/volume_unmanage.py @@ -12,6 +12,7 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging import webob from webob import exc @@ -19,7 +20,6 @@ from cinder.api import extensions from cinder.api.openstack import wsgi from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder import volume LOG = logging.getLogger(__name__) diff --git a/cinder/api/extensions.py b/cinder/api/extensions.py index 579bdf31a..9b75f03d1 100644 --- a/cinder/api/extensions.py +++ b/cinder/api/extensions.py @@ -17,6 +17,7 @@ import os from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import importutils import webob.dec import webob.exc @@ -26,7 +27,6 @@ from cinder.api.openstack import wsgi from cinder.api import xmlutil from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging import cinder.policy diff --git a/cinder/api/middleware/auth.py b/cinder/api/middleware/auth.py index 7fee956b1..66e44a13f 100644 --- a/cinder/api/middleware/auth.py +++ b/cinder/api/middleware/auth.py @@ -21,6 +21,7 @@ Common Auth Middleware. import os from oslo_config import cfg +from oslo_log import log as logging from oslo_serialization import jsonutils import webob.dec import webob.exc @@ -28,7 +29,6 @@ import webob.exc from cinder.api.openstack import wsgi from cinder import context from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder.openstack.common.middleware import request_id from cinder import wsgi as base_wsgi diff --git a/cinder/api/middleware/fault.py b/cinder/api/middleware/fault.py index 2122dc992..cb13f75b7 100644 --- a/cinder/api/middleware/fault.py +++ b/cinder/api/middleware/fault.py @@ -14,13 +14,13 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging import webob.dec import webob.exc from cinder.api.openstack import wsgi from cinder import exception from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder import utils from cinder import wsgi as base_wsgi diff --git a/cinder/api/middleware/sizelimit.py b/cinder/api/middleware/sizelimit.py index 7a69826ba..97a4d125f 100644 --- a/cinder/api/middleware/sizelimit.py +++ b/cinder/api/middleware/sizelimit.py @@ -18,11 +18,11 @@ Request Body limiting middleware. from oslo_config import cfg +from oslo_log import log as logging import webob.dec import webob.exc from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import wsgi diff --git a/cinder/api/openstack/__init__.py b/cinder/api/openstack/__init__.py index 057e38eb4..3b8dc07c2 100644 --- a/cinder/api/openstack/__init__.py +++ b/cinder/api/openstack/__init__.py @@ -18,11 +18,11 @@ WSGI middleware for OpenStack API controllers. """ +from oslo_log import log as logging import routes from cinder.api.openstack import wsgi from cinder.i18n import _, _LW -from cinder.openstack.common import log as logging from cinder import wsgi as base_wsgi diff --git a/cinder/api/openstack/wsgi.py b/cinder/api/openstack/wsgi.py index 2704d9298..45979c612 100644 --- a/cinder/api/openstack/wsgi.py +++ b/cinder/api/openstack/wsgi.py @@ -21,6 +21,7 @@ from xml.dom import minidom from xml.parsers import expat from lxml import etree +from oslo_log import log as logging from oslo_serialization import jsonutils from oslo_utils import excutils import six @@ -29,7 +30,6 @@ import webob from cinder import exception from cinder import i18n from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder import utils from cinder import wsgi diff --git a/cinder/api/urlmap.py b/cinder/api/urlmap.py index d1f2147e4..7b7971767 100644 --- a/cinder/api/urlmap.py +++ b/cinder/api/urlmap.py @@ -16,10 +16,10 @@ import re import urllib2 +from oslo_log import log as logging import paste.urlmap from cinder.api.openstack import wsgi -from cinder.openstack.common import log as logging _quoted_string_re = r'"[^"\\]*(?:\\.[^"\\]*)*"' diff --git a/cinder/api/v1/router.py b/cinder/api/v1/router.py index 12259ec00..97e2807ee 100644 --- a/cinder/api/v1/router.py +++ b/cinder/api/v1/router.py @@ -19,6 +19,8 @@ WSGI middleware for OpenStack Volume API. """ +from oslo_log import log as logging + from cinder.api import extensions import cinder.api.openstack from cinder.api.v1 import limits @@ -28,7 +30,6 @@ from cinder.api.v1 import types from cinder.api.v1 import volume_metadata from cinder.api.v1 import volumes from cinder.api import versions -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/api/v1/snapshots.py b/cinder/api/v1/snapshots.py index 7bf0a84e3..95e448f37 100644 --- a/cinder/api/v1/snapshots.py +++ b/cinder/api/v1/snapshots.py @@ -15,6 +15,7 @@ """The volumes snapshots api.""" +from oslo_log import log as logging from oslo_utils import strutils import webob from webob import exc @@ -24,7 +25,6 @@ from cinder.api.openstack import wsgi from cinder.api import xmlutil from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder import utils from cinder import volume diff --git a/cinder/api/v1/volumes.py b/cinder/api/v1/volumes.py index 21029d4f9..d7f89f21d 100644 --- a/cinder/api/v1/volumes.py +++ b/cinder/api/v1/volumes.py @@ -17,6 +17,7 @@ import ast +from oslo_log import log as logging from oslo_utils import uuidutils import webob from webob import exc @@ -26,7 +27,6 @@ from cinder.api.openstack import wsgi from cinder.api import xmlutil from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder import utils from cinder import volume as cinder_volume from cinder.volume import utils as volume_utils diff --git a/cinder/api/v2/router.py b/cinder/api/v2/router.py index db9a8b455..8ae0460f2 100644 --- a/cinder/api/v2/router.py +++ b/cinder/api/v2/router.py @@ -19,6 +19,8 @@ WSGI middleware for OpenStack Volume API. """ +from oslo_log import log as logging + from cinder.api import extensions import cinder.api.openstack from cinder.api.v2 import limits @@ -28,7 +30,6 @@ from cinder.api.v2 import types from cinder.api.v2 import volume_metadata from cinder.api.v2 import volumes from cinder.api import versions -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/api/v2/snapshots.py b/cinder/api/v2/snapshots.py index 029e29feb..4cb663fe4 100644 --- a/cinder/api/v2/snapshots.py +++ b/cinder/api/v2/snapshots.py @@ -15,6 +15,7 @@ """The volumes snapshots api.""" +from oslo_log import log as logging from oslo_utils import strutils import webob from webob import exc @@ -24,7 +25,6 @@ from cinder.api.openstack import wsgi from cinder.api import xmlutil from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder import utils from cinder import volume diff --git a/cinder/api/v2/views/volumes.py b/cinder/api/v2/views/volumes.py index 77303b298..6ea89a78d 100644 --- a/cinder/api/v2/views/volumes.py +++ b/cinder/api/v2/views/volumes.py @@ -13,8 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging + from cinder.api import common -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/api/v2/volumes.py b/cinder/api/v2/volumes.py index 6a2e34707..26eb42a80 100644 --- a/cinder/api/v2/volumes.py +++ b/cinder/api/v2/volumes.py @@ -18,6 +18,7 @@ import ast +from oslo_log import log as logging from oslo_utils import uuidutils import webob from webob import exc @@ -30,7 +31,6 @@ from cinder import consistencygroup as consistencygroupAPI from cinder import exception from cinder.i18n import _, _LI from cinder.image import glance -from cinder.openstack.common import log as logging from cinder import utils from cinder import volume as cinder_volume from cinder.volume import utils as volume_utils diff --git a/cinder/api/views/backups.py b/cinder/api/views/backups.py index aafd11ef9..ce6bd5397 100644 --- a/cinder/api/views/backups.py +++ b/cinder/api/views/backups.py @@ -13,8 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging + from cinder.api import common -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/api/views/cgsnapshots.py b/cinder/api/views/cgsnapshots.py index 5d9186ad8..b8b7eddce 100644 --- a/cinder/api/views/cgsnapshots.py +++ b/cinder/api/views/cgsnapshots.py @@ -13,8 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging + from cinder.api import common -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/api/views/consistencygroups.py b/cinder/api/views/consistencygroups.py index b2458a011..50a2b1297 100644 --- a/cinder/api/views/consistencygroups.py +++ b/cinder/api/views/consistencygroups.py @@ -13,8 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging + from cinder.api import common -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/api/views/qos_specs.py b/cinder/api/views/qos_specs.py index 0241a12ef..301623fea 100644 --- a/cinder/api/views/qos_specs.py +++ b/cinder/api/views/qos_specs.py @@ -13,8 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging + from cinder.api import common -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/api/views/transfers.py b/cinder/api/views/transfers.py index 3cc757f86..dbacb2c19 100644 --- a/cinder/api/views/transfers.py +++ b/cinder/api/views/transfers.py @@ -13,8 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging + from cinder.api import common -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/backup/api.py b/cinder/backup/api.py index 1d0786a41..627635330 100644 --- a/cinder/backup/api.py +++ b/cinder/backup/api.py @@ -22,6 +22,7 @@ Handles all requests relating to the volume backups service. from eventlet import greenthread from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from cinder.backup import rpcapi as backup_rpcapi @@ -29,7 +30,6 @@ from cinder import context from cinder.db import base from cinder import exception from cinder.i18n import _, _LI, _LW -from cinder.openstack.common import log as logging import cinder.policy from cinder import quota from cinder import utils diff --git a/cinder/backup/chunkeddriver.py b/cinder/backup/chunkeddriver.py index 00427904d..1750fdd04 100644 --- a/cinder/backup/chunkeddriver.py +++ b/cinder/backup/chunkeddriver.py @@ -28,6 +28,7 @@ import os import eventlet from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units import six @@ -35,7 +36,6 @@ import six from cinder.backup import driver from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder.volume import utils as volume_utils diff --git a/cinder/backup/driver.py b/cinder/backup/driver.py index 0f20a1275..88c609de8 100644 --- a/cinder/backup/driver.py +++ b/cinder/backup/driver.py @@ -18,6 +18,7 @@ import abc from oslo_config import cfg +from oslo_log import log as logging from oslo_serialization import jsonutils import six @@ -25,7 +26,6 @@ from cinder.db import base from cinder import exception from cinder.i18n import _, _LI, _LE, _LW from cinder import keymgr -from cinder.openstack.common import log as logging service_opts = [ cfg.IntOpt('backup_metadata_version', default=2, diff --git a/cinder/backup/drivers/ceph.py b/cinder/backup/drivers/ceph.py index 034869df7..f0ee60d38 100644 --- a/cinder/backup/drivers/ceph.py +++ b/cinder/backup/drivers/ceph.py @@ -50,6 +50,7 @@ import time import eventlet from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import encodeutils from oslo_utils import excutils from oslo_utils import units @@ -57,7 +58,6 @@ from oslo_utils import units from cinder.backup import driver from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder import utils import cinder.volume.drivers.rbd as rbd_driver diff --git a/cinder/backup/drivers/nfs.py b/cinder/backup/drivers/nfs.py index 7ad7e869d..455d50dfb 100644 --- a/cinder/backup/drivers/nfs.py +++ b/cinder/backup/drivers/nfs.py @@ -19,12 +19,12 @@ import os import os.path from oslo_config import cfg +from oslo_log import log as logging from cinder.backup import chunkeddriver from cinder.brick.remotefs import remotefs as remotefs_brick from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import utils LOG = logging.getLogger(__name__) diff --git a/cinder/backup/drivers/swift.py b/cinder/backup/drivers/swift.py index 1f922b37b..479231586 100644 --- a/cinder/backup/drivers/swift.py +++ b/cinder/backup/drivers/swift.py @@ -39,6 +39,7 @@ import hashlib import socket from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import timeutils import six from swiftclient import client as swift @@ -47,7 +48,6 @@ from cinder.backup import chunkeddriver from cinder import exception from cinder.i18n import _ from cinder.i18n import _LE -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/backup/drivers/tsm.py b/cinder/backup/drivers/tsm.py index 54364c5b0..52b5a95bc 100644 --- a/cinder/backup/drivers/tsm.py +++ b/cinder/backup/drivers/tsm.py @@ -31,11 +31,11 @@ import stat from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from cinder.backup import driver from cinder import exception from cinder.i18n import _LE, _ -from cinder.openstack.common import log as logging from cinder import utils LOG = logging.getLogger(__name__) diff --git a/cinder/backup/manager.py b/cinder/backup/manager.py index 8ab472028..0c6096bc0 100644 --- a/cinder/backup/manager.py +++ b/cinder/backup/manager.py @@ -34,6 +34,7 @@ Volume backups can be created, restored, deleted and listed. """ from oslo_config import cfg +from oslo_log import log as logging import oslo_messaging as messaging from oslo_utils import excutils from oslo_utils import importutils @@ -44,7 +45,6 @@ from cinder import context from cinder import exception from cinder.i18n import _, _LE, _LI, _LW from cinder import manager -from cinder.openstack.common import log as logging from cinder import quota from cinder import rpc from cinder import utils diff --git a/cinder/backup/rpcapi.py b/cinder/backup/rpcapi.py index 6d25bcdad..dc2ebf48b 100644 --- a/cinder/backup/rpcapi.py +++ b/cinder/backup/rpcapi.py @@ -19,9 +19,9 @@ Client side of the volume backup RPC API. from oslo_config import cfg +from oslo_log import log as logging import oslo_messaging as messaging -from cinder.openstack.common import log as logging from cinder import rpc diff --git a/cinder/brick/exception.py b/cinder/brick/exception.py index 598dca24a..3078b7ece 100644 --- a/cinder/brick/exception.py +++ b/cinder/brick/exception.py @@ -14,8 +14,9 @@ """Exceptions for the Brick library.""" +from oslo_log import log as logging + from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/brick/initiator/connector.py b/cinder/brick/initiator/connector.py index c03ff39df..45a85c942 100644 --- a/cinder/brick/initiator/connector.py +++ b/cinder/brick/initiator/connector.py @@ -21,6 +21,7 @@ import time from oslo_concurrency import lockutils from oslo_concurrency import processutils as putils +from oslo_log import log as logging import six from cinder.brick import exception @@ -30,7 +31,6 @@ from cinder.brick.initiator import linuxfc from cinder.brick.initiator import linuxscsi from cinder.brick.remotefs import remotefs from cinder.i18n import _, _LE, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall S390X = "s390x" diff --git a/cinder/brick/initiator/linuxfc.py b/cinder/brick/initiator/linuxfc.py index c6818b587..73a54cbcc 100644 --- a/cinder/brick/initiator/linuxfc.py +++ b/cinder/brick/initiator/linuxfc.py @@ -17,10 +17,10 @@ import errno from oslo_concurrency import processutils as putils +from oslo_log import log as logging from cinder.brick.initiator import linuxscsi from cinder.i18n import _LW -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/brick/initiator/linuxscsi.py b/cinder/brick/initiator/linuxscsi.py index 977007bc3..9fae5a5ff 100644 --- a/cinder/brick/initiator/linuxscsi.py +++ b/cinder/brick/initiator/linuxscsi.py @@ -20,10 +20,10 @@ import os import re from oslo_concurrency import processutils as putils +from oslo_log import log as logging from cinder.brick import executor from cinder.i18n import _, _LW -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/brick/local_dev/lvm.py b/cinder/brick/local_dev/lvm.py index d9ae406a4..2f6a3dc51 100644 --- a/cinder/brick/local_dev/lvm.py +++ b/cinder/brick/local_dev/lvm.py @@ -23,12 +23,12 @@ import os import re from oslo_concurrency import processutils as putils +from oslo_log import log as logging from oslo_utils import excutils from cinder.brick import exception from cinder.brick import executor from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder import utils diff --git a/cinder/brick/remotefs/remotefs.py b/cinder/brick/remotefs/remotefs.py index 7eaf7d71d..72252fae0 100644 --- a/cinder/brick/remotefs/remotefs.py +++ b/cinder/brick/remotefs/remotefs.py @@ -20,11 +20,11 @@ import os import re from oslo_concurrency import processutils as putils +from oslo_log import log as logging import six from cinder.brick import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/cmd/all.py b/cinder/cmd/all.py index f6c2a0ea6..b2159b01b 100644 --- a/cinder/cmd/all.py +++ b/cinder/cmd/all.py @@ -34,6 +34,7 @@ import warnings warnings.simplefilter('once', DeprecationWarning) from oslo_config import cfg +from oslo_log import log as logging from cinder import i18n i18n.enable_lazy() @@ -41,7 +42,6 @@ i18n.enable_lazy() # Need to register global_opts from cinder.common import config # noqa from cinder.i18n import _LE -from cinder.openstack.common import log as logging from cinder import service from cinder import utils from cinder import version @@ -53,7 +53,7 @@ CONF = cfg.CONF def main(): CONF(sys.argv[1:], project='cinder', version=version.version_string()) - logging.setup("cinder") + logging.setup(CONF, "cinder") LOG = logging.getLogger('cinder.all') utils.monkey_patch() diff --git a/cinder/cmd/api.py b/cinder/cmd/api.py index c3eb509e7..471ed7ee7 100644 --- a/cinder/cmd/api.py +++ b/cinder/cmd/api.py @@ -28,13 +28,13 @@ from cinder import objects warnings.simplefilter('once', DeprecationWarning) from oslo_config import cfg +from oslo_log import log as logging from cinder import i18n i18n.enable_lazy() # Need to register global_opts from cinder.common import config # noqa -from cinder.openstack.common import log as logging from cinder import rpc from cinder import service from cinder import utils @@ -48,7 +48,7 @@ def main(): objects.register_all() CONF(sys.argv[1:], project='cinder', version=version.version_string()) - logging.setup("cinder") + logging.setup(CONF, "cinder") utils.monkey_patch() rpc.init(CONF) diff --git a/cinder/cmd/backup.py b/cinder/cmd/backup.py index df44560a5..3231aebdd 100644 --- a/cinder/cmd/backup.py +++ b/cinder/cmd/backup.py @@ -24,6 +24,7 @@ warnings.simplefilter('once', DeprecationWarning) import eventlet from oslo_config import cfg +from oslo_log import log as logging eventlet.monkey_patch() @@ -32,7 +33,6 @@ i18n.enable_lazy() # Need to register global_opts from cinder.common import config # noqa -from cinder.openstack.common import log as logging from cinder import service from cinder import utils from cinder import version @@ -44,7 +44,7 @@ CONF = cfg.CONF def main(): CONF(sys.argv[1:], project='cinder', version=version.version_string()) - logging.setup("cinder") + logging.setup(CONF, "cinder") utils.monkey_patch() server = service.Service.create(binary='cinder-backup') service.serve(server) diff --git a/cinder/cmd/manage.py b/cinder/cmd/manage.py index 721d5c54a..57b5683a7 100644 --- a/cinder/cmd/manage.py +++ b/cinder/cmd/manage.py @@ -63,6 +63,7 @@ warnings.simplefilter('once', DeprecationWarning) from oslo_config import cfg from oslo_db.sqlalchemy import migration +from oslo_log import log as logging import oslo_messaging as messaging from oslo_utils import uuidutils @@ -77,7 +78,6 @@ from cinder.db import migration as db_migration from cinder.db.sqlalchemy import api as db_api from cinder.i18n import _ from cinder.objects import base as objects_base -from cinder.openstack.common import log as logging from cinder import rpc from cinder import utils from cinder import version @@ -546,7 +546,7 @@ def main(): try: CONF(sys.argv[1:], project='cinder', version=version.version_string()) - logging.setup("cinder") + logging.setup(CONF, "cinder") except cfg.ConfigFilesNotFoundError: cfgfile = CONF.config_file[-1] if CONF.config_file else None if cfgfile and not os.access(cfgfile, os.R_OK): diff --git a/cinder/cmd/scheduler.py b/cinder/cmd/scheduler.py index 8ef5b37b3..db862b988 100644 --- a/cinder/cmd/scheduler.py +++ b/cinder/cmd/scheduler.py @@ -26,13 +26,13 @@ import warnings warnings.simplefilter('once', DeprecationWarning) from oslo_config import cfg +from oslo_log import log as logging from cinder import i18n i18n.enable_lazy() # Need to register global_opts from cinder.common import config # noqa -from cinder.openstack.common import log as logging from cinder import service from cinder import utils from cinder import version @@ -44,7 +44,7 @@ CONF = cfg.CONF def main(): CONF(sys.argv[1:], project='cinder', version=version.version_string()) - logging.setup("cinder") + logging.setup(CONF, "cinder") utils.monkey_patch() server = service.Service.create(binary='cinder-scheduler') service.serve(server) diff --git a/cinder/cmd/volume.py b/cinder/cmd/volume.py index ba50ea5eb..f72864034 100644 --- a/cinder/cmd/volume.py +++ b/cinder/cmd/volume.py @@ -36,13 +36,13 @@ import warnings warnings.simplefilter('once', DeprecationWarning) from oslo_config import cfg +from oslo_log import log as logging from cinder import i18n i18n.enable_lazy() # Need to register global_opts from cinder.common import config # noqa -from cinder.openstack.common import log as logging from cinder import service from cinder import utils from cinder import version @@ -59,7 +59,7 @@ def main(): objects.register_all() CONF(sys.argv[1:], project='cinder', version=version.version_string()) - logging.setup("cinder") + logging.setup(CONF, "cinder") utils.monkey_patch() launcher = service.get_launcher() if CONF.enabled_backends: diff --git a/cinder/cmd/volume_usage_audit.py b/cinder/cmd/volume_usage_audit.py index c0e716cbc..6642d318e 100644 --- a/cinder/cmd/volume_usage_audit.py +++ b/cinder/cmd/volume_usage_audit.py @@ -42,13 +42,13 @@ import warnings warnings.simplefilter('once', DeprecationWarning) from oslo_config import cfg +from oslo_log import log as logging from cinder import i18n i18n.enable_lazy() from cinder import context from cinder import db from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder import rpc from cinder import utils from cinder import version @@ -79,7 +79,7 @@ def main(): admin_context = context.get_admin_context() CONF(sys.argv[1:], project='cinder', version=version.version_string()) - logging.setup("cinder") + logging.setup(CONF, "cinder") LOG = logging.getLogger("cinder") rpc.init(CONF) begin, end = utils.last_completed_audit_period() diff --git a/cinder/common/config.py b/cinder/common/config.py index 0c4f57bad..f6a49c7c2 100644 --- a/cinder/common/config.py +++ b/cinder/common/config.py @@ -28,12 +28,14 @@ stepping stone. import socket from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import netutils from cinder.i18n import _ CONF = cfg.CONF +logging.register_options(CONF) core_opts = [ cfg.StrOpt('api_paste_config', diff --git a/cinder/common/sqlalchemyutils.py b/cinder/common/sqlalchemyutils.py index b35130ada..baa0e982d 100644 --- a/cinder/common/sqlalchemyutils.py +++ b/cinder/common/sqlalchemyutils.py @@ -18,11 +18,11 @@ """Implementation of paginate query.""" +from oslo_log import log as logging import sqlalchemy from cinder import exception from cinder.i18n import _, _LW -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/compute/nova.py b/cinder/compute/nova.py index 7d8193625..65060bff4 100644 --- a/cinder/compute/nova.py +++ b/cinder/compute/nova.py @@ -24,12 +24,12 @@ from novaclient.v1_1 import client as nova_client from novaclient.v1_1.contrib import assisted_volume_snapshots from novaclient.v1_1.contrib import list_extensions from oslo_config import cfg +from oslo_log import log as logging from requests import exceptions as request_exceptions from cinder import context as ctx from cinder.db import base from cinder import exception -from cinder.openstack.common import log as logging nova_opts = [ cfg.StrOpt('nova_catalog_info', diff --git a/cinder/consistencygroup/api.py b/cinder/consistencygroup/api.py index 25f36b79e..5e4b27320 100644 --- a/cinder/consistencygroup/api.py +++ b/cinder/consistencygroup/api.py @@ -21,13 +21,13 @@ Handles all requests relating to consistency groups. import functools from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import timeutils from cinder.db import base from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging import cinder.policy from cinder import quota from cinder.scheduler import rpcapi as scheduler_rpcapi diff --git a/cinder/context.py b/cinder/context.py index e9879d865..e5a1eb79f 100644 --- a/cinder/context.py +++ b/cinder/context.py @@ -20,11 +20,11 @@ import copy from oslo_context import context +from oslo_log import log as logging from oslo_utils import timeutils from cinder.i18n import _ from cinder.openstack.common import local -from cinder.openstack.common import log as logging from cinder import policy diff --git a/cinder/db/sqlalchemy/api.py b/cinder/db/sqlalchemy/api.py index 6b5b4bdcb..2adf45628 100644 --- a/cinder/db/sqlalchemy/api.py +++ b/cinder/db/sqlalchemy/api.py @@ -31,6 +31,7 @@ from oslo_config import cfg from oslo_db import exception as db_exc from oslo_db import options from oslo_db.sqlalchemy import session as db_session +from oslo_log import log as logging from oslo_utils import timeutils from oslo_utils import uuidutils import osprofiler.sqlalchemy @@ -49,7 +50,6 @@ from cinder.common import sqlalchemyutils from cinder.db.sqlalchemy import models from cinder import exception from cinder.i18n import _, _LW, _LE, _LI -from cinder.openstack.common import log as logging CONF = cfg.CONF diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/001_cinder_init.py b/cinder/db/sqlalchemy/migrate_repo/versions/001_cinder_init.py index 5df0424b4..b22e43a1f 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/001_cinder_init.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/001_cinder_init.py @@ -12,12 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. - +from oslo_log import log as logging from sqlalchemy import Boolean, Column, DateTime, ForeignKey from sqlalchemy import Integer, MetaData, String, Table from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/002_quota_class.py b/cinder/db/sqlalchemy/migrate_repo/versions/002_quota_class.py index a3ed1aa38..0227ab466 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/002_quota_class.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/002_quota_class.py @@ -13,11 +13,11 @@ # under the License. from migrate import ForeignKeyConstraint +from oslo_log import log as logging from sqlalchemy import Boolean, Column, DateTime from sqlalchemy import MetaData, Integer, String, Table, ForeignKey from cinder.i18n import _LE -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/003_glance_metadata.py b/cinder/db/sqlalchemy/migrate_repo/versions/003_glance_metadata.py index 8c3ae7b90..9f07a2f2d 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/003_glance_metadata.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/003_glance_metadata.py @@ -12,11 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Column, DateTime, Text, Boolean from sqlalchemy import MetaData, Integer, String, Table, ForeignKey from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/004_volume_type_to_uuid.py b/cinder/db/sqlalchemy/migrate_repo/versions/004_volume_type_to_uuid.py index 8469b0954..253ba6523 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/004_volume_type_to_uuid.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/004_volume_type_to_uuid.py @@ -13,10 +13,9 @@ import uuid from migrate import ForeignKeyConstraint +from oslo_log import log as logging from sqlalchemy import Integer, MetaData, String, Table -from cinder.openstack.common import log as logging - LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/005_add_source_volume_column.py b/cinder/db/sqlalchemy/migrate_repo/versions/005_add_source_volume_column.py index 9291bb2ee..caf8b54ed 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/005_add_source_volume_column.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/005_add_source_volume_column.py @@ -10,12 +10,10 @@ # License for the specific language governing permissions and limitations # under the License. - +from oslo_log import log as logging from sqlalchemy import Column from sqlalchemy import MetaData, String, Table -from cinder.openstack.common import log as logging - LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/008_add_backup.py b/cinder/db/sqlalchemy/migrate_repo/versions/008_add_backup.py index 22b2eeda2..59610adec 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/008_add_backup.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/008_add_backup.py @@ -13,11 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Boolean, Column, DateTime from sqlalchemy import MetaData, Integer, String, Table from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/009_add_snapshot_metadata_table.py b/cinder/db/sqlalchemy/migrate_repo/versions/009_add_snapshot_metadata_table.py index 90dfdfe17..b5377115e 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/009_add_snapshot_metadata_table.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/009_add_snapshot_metadata_table.py @@ -10,11 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Boolean, Column, DateTime from sqlalchemy import Integer, MetaData, String, Table, ForeignKey from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/010_add_transfers_table.py b/cinder/db/sqlalchemy/migrate_repo/versions/010_add_transfers_table.py index 37d129293..9f5b2dec3 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/010_add_transfers_table.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/010_add_transfers_table.py @@ -10,11 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Boolean, Column, DateTime from sqlalchemy import MetaData, String, Table, ForeignKey from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/015_drop_migrations_table.py b/cinder/db/sqlalchemy/migrate_repo/versions/015_drop_migrations_table.py index 04de18011..3ae81aa6d 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/015_drop_migrations_table.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/015_drop_migrations_table.py @@ -10,11 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Boolean, Column, DateTime, Integer from sqlalchemy import MetaData, String, Table from cinder.i18n import _LE -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/016_drop_sm_tables.py b/cinder/db/sqlalchemy/migrate_repo/versions/016_drop_sm_tables.py index e6b6ccd45..20aa71393 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/016_drop_sm_tables.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/016_drop_sm_tables.py @@ -12,11 +12,11 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Boolean, Column, DateTime, ForeignKey from sqlalchemy import Integer, MetaData, String, Table from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/017_add_encryption_information.py b/cinder/db/sqlalchemy/migrate_repo/versions/017_add_encryption_information.py index d2f7eedf1..766eaffd0 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/017_add_encryption_information.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/017_add_encryption_information.py @@ -13,11 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Column, ForeignKey, MetaData, Table from sqlalchemy import Boolean, DateTime, Integer, String from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/018_add_qos_specs.py b/cinder/db/sqlalchemy/migrate_repo/versions/018_add_qos_specs.py index 6be70cb4a..643d6b785 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/018_add_qos_specs.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/018_add_qos_specs.py @@ -14,12 +14,12 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Boolean, Column, DateTime from sqlalchemy import ForeignKey, MetaData, String, Table from migrate import ForeignKeyConstraint from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/020_add_volume_admin_metadata_table.py b/cinder/db/sqlalchemy/migrate_repo/versions/020_add_volume_admin_metadata_table.py index e8cdee8d4..5d52ccd86 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/020_add_volume_admin_metadata_table.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/020_add_volume_admin_metadata_table.py @@ -10,11 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Boolean, Column, DateTime from sqlalchemy import Integer, MetaData, String, Table, ForeignKey from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/021_add_default_quota_class.py b/cinder/db/sqlalchemy/migrate_repo/versions/021_add_default_quota_class.py index 2ccbc197c..ee6911629 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/021_add_default_quota_class.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/021_add_default_quota_class.py @@ -15,10 +15,10 @@ import datetime from oslo_config import cfg +from oslo_log import log as logging from sqlalchemy import MetaData, Table from cinder.i18n import _LE, _LI -from cinder.openstack.common import log as logging # Get default values via config. The defaults will either # come from the default values set in the quota option diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/023_add_expire_reservations_index.py b/cinder/db/sqlalchemy/migrate_repo/versions/023_add_expire_reservations_index.py index c8a0e7fdf..07fa3f7a8 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/023_add_expire_reservations_index.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/023_add_expire_reservations_index.py @@ -12,10 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Index, MetaData, Table from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/024_add_replication_support.py b/cinder/db/sqlalchemy/migrate_repo/versions/024_add_replication_support.py index 3401f862d..2a06b01bb 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/024_add_replication_support.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/024_add_replication_support.py @@ -12,11 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Column from sqlalchemy import MetaData, String, Table -from cinder.openstack.common import log as logging - LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/025_add_consistencygroup.py b/cinder/db/sqlalchemy/migrate_repo/versions/025_add_consistencygroup.py index d05e5e564..82d48c16c 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/025_add_consistencygroup.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/025_add_consistencygroup.py @@ -14,11 +14,11 @@ # under the License. from migrate import ForeignKeyConstraint +from oslo_log import log as logging from sqlalchemy import Boolean, Column, DateTime from sqlalchemy import ForeignKey, MetaData, String, Table from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/026_add_consistencygroup_quota_class.py b/cinder/db/sqlalchemy/migrate_repo/versions/026_add_consistencygroup_quota_class.py index de26615d9..361554c5e 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/026_add_consistencygroup_quota_class.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/026_add_consistencygroup_quota_class.py @@ -15,10 +15,10 @@ import datetime from oslo_config import cfg +from oslo_log import log as logging from sqlalchemy import MetaData, Table from cinder.i18n import _ -from cinder.openstack.common import log as logging # Get default values via config. The defaults will either # come from the default values set in the quota option diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/032_add_volume_type_projects.py b/cinder/db/sqlalchemy/migrate_repo/versions/032_add_volume_type_projects.py index 693e4a76c..a72b8cb7a 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/032_add_volume_type_projects.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/032_add_volume_type_projects.py @@ -10,11 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Boolean, Column, DateTime, UniqueConstraint from sqlalchemy import Integer, MetaData, String, Table, ForeignKey from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/037_add_cgsnapshot_id_column_to_consistencygroups.py b/cinder/db/sqlalchemy/migrate_repo/versions/037_add_cgsnapshot_id_column_to_consistencygroups.py index fd1cb3dd9..237389c14 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/037_add_cgsnapshot_id_column_to_consistencygroups.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/037_add_cgsnapshot_id_column_to_consistencygroups.py @@ -10,11 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Column from sqlalchemy import MetaData, String, Table from cinder.i18n import _LE -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/038_add_driver_initiator_data_table.py b/cinder/db/sqlalchemy/migrate_repo/versions/038_add_driver_initiator_data_table.py index 63974340e..dc3cfb944 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/038_add_driver_initiator_data_table.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/038_add_driver_initiator_data_table.py @@ -10,11 +10,11 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Column, DateTime, Integer from sqlalchemy import MetaData, String, Table, UniqueConstraint from cinder.i18n import _LE -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/039_add_parent_id_to_backups.py b/cinder/db/sqlalchemy/migrate_repo/versions/039_add_parent_id_to_backups.py index 54063d37c..c8374e7c2 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/039_add_parent_id_to_backups.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/039_add_parent_id_to_backups.py @@ -14,10 +14,10 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from sqlalchemy import Column, MetaData, String, Table from cinder.i18n import _LE -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/db/sqlalchemy/migrate_repo/versions/040_add_volume_attachment.py b/cinder/db/sqlalchemy/migrate_repo/versions/040_add_volume_attachment.py index 1d892f810..0c05af48e 100644 --- a/cinder/db/sqlalchemy/migrate_repo/versions/040_add_volume_attachment.py +++ b/cinder/db/sqlalchemy/migrate_repo/versions/040_add_volume_attachment.py @@ -16,12 +16,12 @@ import datetime import uuid +from oslo_log import log as logging import six from sqlalchemy import Boolean, Column, DateTime from sqlalchemy import ForeignKey, MetaData, String, Table from cinder.i18n import _LE -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/exception.py b/cinder/exception.py index bc1ac25a3..8ac992c54 100644 --- a/cinder/exception.py +++ b/cinder/exception.py @@ -25,11 +25,11 @@ SHOULD include dedicated exception logging. import sys from oslo_config import cfg +from oslo_log import log as logging import six import webob.exc from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/flow_utils.py b/cinder/flow_utils.py index e9041f892..3bca9c820 100644 --- a/cinder/flow_utils.py +++ b/cinder/flow_utils.py @@ -12,13 +12,13 @@ import os +from oslo_log import log as logging # For more information please visit: https://wiki.openstack.org/wiki/TaskFlow from taskflow.listeners import base from taskflow.listeners import logging as logging_listener from taskflow import task from cinder import exception -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/image/glance.py b/cinder/image/glance.py index 7607daf87..f94ff4c9d 100644 --- a/cinder/image/glance.py +++ b/cinder/image/glance.py @@ -28,13 +28,13 @@ import time import glanceclient.exc from oslo_config import cfg +from oslo_log import log as logging from oslo_serialization import jsonutils from oslo_utils import timeutils import six.moves.urllib.parse as urlparse from cinder import exception from cinder.i18n import _, _LW -from cinder.openstack.common import log as logging glance_opts = [ diff --git a/cinder/image/image_utils.py b/cinder/image/image_utils.py index ed724be61..902c444e2 100644 --- a/cinder/image/image_utils.py +++ b/cinder/image/image_utils.py @@ -31,6 +31,7 @@ import tempfile from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import timeutils from oslo_utils import units @@ -38,7 +39,6 @@ from cinder import exception from cinder.i18n import _ from cinder.openstack.common import fileutils from cinder.openstack.common import imageutils -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume import throttling from cinder.volume import utils as volume_utils diff --git a/cinder/keymgr/barbican.py b/cinder/keymgr/barbican.py index 34c6d79bc..b984fb90e 100644 --- a/cinder/keymgr/barbican.py +++ b/cinder/keymgr/barbican.py @@ -25,13 +25,13 @@ from barbicanclient import client as barbican_client from keystoneclient.auth import identity from keystoneclient import session from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from cinder import exception from cinder.i18n import _, _LE from cinder.keymgr import key as keymgr_key from cinder.keymgr import key_mgr -from cinder.openstack.common import log as logging CONF = cfg.CONF CONF.import_opt('encryption_auth_url', 'cinder.keymgr.key_mgr', group='keymgr') diff --git a/cinder/keymgr/conf_key_mgr.py b/cinder/keymgr/conf_key_mgr.py index 3357be10d..701581483 100644 --- a/cinder/keymgr/conf_key_mgr.py +++ b/cinder/keymgr/conf_key_mgr.py @@ -34,12 +34,12 @@ encryption key so *any* volume can be decrypted once the fixed key is known. import array from oslo_config import cfg +from oslo_log import log as logging from cinder import exception from cinder.i18n import _, _LW from cinder.keymgr import key from cinder.keymgr import key_mgr -from cinder.openstack.common import log as logging key_mgr_opts = [ diff --git a/cinder/manager.py b/cinder/manager.py index 7bd679bb1..6d3453d50 100644 --- a/cinder/manager.py +++ b/cinder/manager.py @@ -53,10 +53,10 @@ This module provides Manager, a base class for managers. from oslo_config import cfg +from oslo_log import log as logging import oslo_messaging as messaging from cinder.db import base -from cinder.openstack.common import log as logging from cinder.openstack.common import periodic_task from cinder.scheduler import rpcapi as scheduler_rpcapi from cinder import version diff --git a/cinder/objects/base.py b/cinder/objects/base.py index c33883699..22ef47c7b 100644 --- a/cinder/objects/base.py +++ b/cinder/objects/base.py @@ -23,6 +23,7 @@ import traceback import netaddr from oslo import messaging +from oslo_log import log as logging from oslo_utils import timeutils import six @@ -31,7 +32,6 @@ from cinder import exception from cinder.i18n import _, _LE from cinder import objects from cinder.objects import fields -from cinder.openstack.common import log as logging from cinder.openstack.common import versionutils from cinder import utils diff --git a/cinder/objects/snapshot.py b/cinder/objects/snapshot.py index 5fc8d8399..06accd758 100644 --- a/cinder/objects/snapshot.py +++ b/cinder/objects/snapshot.py @@ -13,6 +13,7 @@ # under the License. from oslo_config import cfg +from oslo_log import log as logging from cinder import db from cinder import exception @@ -20,7 +21,6 @@ from cinder.i18n import _ from cinder import objects from cinder.objects import base from cinder.objects import fields -from cinder.openstack.common import log as logging from cinder import utils CONF = cfg.CONF diff --git a/cinder/objects/volume.py b/cinder/objects/volume.py index 022c462d8..6ba556b3a 100644 --- a/cinder/objects/volume.py +++ b/cinder/objects/volume.py @@ -13,6 +13,7 @@ # under the License. from oslo_config import cfg +from oslo_log import log as logging from cinder import db from cinder import exception @@ -20,7 +21,6 @@ from cinder.i18n import _ from cinder import objects from cinder.objects import base from cinder.objects import fields -from cinder.openstack.common import log as logging from cinder import utils CONF = cfg.CONF diff --git a/cinder/openstack/common/log.py b/cinder/openstack/common/log.py deleted file mode 100644 index 831a22679..000000000 --- a/cinder/openstack/common/log.py +++ /dev/null @@ -1,718 +0,0 @@ -# Copyright 2011 OpenStack Foundation. -# Copyright 2010 United States Government as represented by the -# Administrator of the National Aeronautics and Space Administration. -# All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -"""OpenStack logging handler. - -This module adds to logging functionality by adding the option to specify -a context object when calling the various log methods. If the context object -is not specified, default formatting is used. Additionally, an instance uuid -may be passed as part of the log message, which is intended to make it easier -for admins to find messages related to a specific instance. - -It also allows setting of formatting information through conf. - -""" - -import copy -import inspect -import itertools -import logging -import logging.config -import logging.handlers -import os -import socket -import sys -import traceback - -from oslo.config import cfg -from oslo.serialization import jsonutils -from oslo.utils import importutils -import six -from six import moves - -_PY26 = sys.version_info[0:2] == (2, 6) - -from cinder.openstack.common._i18n import _ -from cinder.openstack.common import local - - -_DEFAULT_LOG_DATE_FORMAT = "%Y-%m-%d %H:%M:%S" - - -common_cli_opts = [ - cfg.BoolOpt('debug', - short='d', - default=False, - help='Print debugging output (set logging level to ' - 'DEBUG instead of default WARNING level).'), - cfg.BoolOpt('verbose', - short='v', - default=False, - help='Print more verbose output (set logging level to ' - 'INFO instead of default WARNING level).'), -] - -logging_cli_opts = [ - cfg.StrOpt('log-config-append', - metavar='PATH', - deprecated_name='log-config', - help='The name of a logging configuration file. This file ' - 'is appended to any existing logging configuration ' - 'files. For details about logging configuration files, ' - 'see the Python logging module documentation.'), - cfg.StrOpt('log-format', - metavar='FORMAT', - help='DEPRECATED. ' - 'A logging.Formatter log message format string which may ' - 'use any of the available logging.LogRecord attributes. ' - 'This option is deprecated. Please use ' - 'logging_context_format_string and ' - 'logging_default_format_string instead.'), - cfg.StrOpt('log-date-format', - default=_DEFAULT_LOG_DATE_FORMAT, - metavar='DATE_FORMAT', - help='Format string for %%(asctime)s in log records. ' - 'Default: %(default)s .'), - cfg.StrOpt('log-file', - metavar='PATH', - deprecated_name='logfile', - help='(Optional) Name of log file to output to. ' - 'If no default is set, logging will go to stdout.'), - cfg.StrOpt('log-dir', - deprecated_name='logdir', - help='(Optional) The base directory used for relative ' - '--log-file paths.'), - cfg.BoolOpt('use-syslog', - default=False, - help='Use syslog for logging. ' - 'Existing syslog format is DEPRECATED during I, ' - 'and will change in J to honor RFC5424.'), - cfg.BoolOpt('use-syslog-rfc-format', - # TODO(bogdando) remove or use True after existing - # syslog format deprecation in J - default=False, - help='(Optional) Enables or disables syslog rfc5424 format ' - 'for logging. If enabled, prefixes the MSG part of the ' - 'syslog message with APP-NAME (RFC5424). The ' - 'format without the APP-NAME is deprecated in I, ' - 'and will be removed in J.'), - cfg.StrOpt('syslog-log-facility', - default='LOG_USER', - help='Syslog facility to receive log lines.') -] - -generic_log_opts = [ - cfg.BoolOpt('use_stderr', - default=True, - help='Log output to standard error.') -] - -DEFAULT_LOG_LEVELS = ['amqp=WARN', 'amqplib=WARN', 'boto=WARN', - 'qpid=WARN', 'sqlalchemy=WARN', 'suds=INFO', - 'oslo.messaging=INFO', 'iso8601=WARN', - 'requests.packages.urllib3.connectionpool=WARN', - 'urllib3.connectionpool=WARN', 'websocket=WARN', - "keystonemiddleware=WARN", "routes.middleware=WARN", - "stevedore=WARN"] - -log_opts = [ - cfg.StrOpt('logging_context_format_string', - default='%(asctime)s.%(msecs)03d %(process)d %(levelname)s ' - '%(name)s [%(request_id)s %(user_identity)s] ' - '%(instance)s%(message)s', - help='Format string to use for log messages with context.'), - cfg.StrOpt('logging_default_format_string', - default='%(asctime)s.%(msecs)03d %(process)d %(levelname)s ' - '%(name)s [-] %(instance)s%(message)s', - help='Format string to use for log messages without context.'), - cfg.StrOpt('logging_debug_format_suffix', - default='%(funcName)s %(pathname)s:%(lineno)d', - help='Data to append to log format when level is DEBUG.'), - cfg.StrOpt('logging_exception_prefix', - default='%(asctime)s.%(msecs)03d %(process)d TRACE %(name)s ' - '%(instance)s', - help='Prefix each line of exception output with this format.'), - cfg.ListOpt('default_log_levels', - default=DEFAULT_LOG_LEVELS, - help='List of logger=LEVEL pairs.'), - cfg.BoolOpt('publish_errors', - default=False, - help='Enables or disables publication of error events.'), - cfg.BoolOpt('fatal_deprecations', - default=False, - help='Enables or disables fatal status of deprecations.'), - - # NOTE(mikal): there are two options here because sometimes we are handed - # a full instance (and could include more information), and other times we - # are just handed a UUID for the instance. - cfg.StrOpt('instance_format', - default='[instance: %(uuid)s] ', - help='The format for an instance that is passed with the log ' - 'message.'), - cfg.StrOpt('instance_uuid_format', - default='[instance: %(uuid)s] ', - help='The format for an instance UUID that is passed with the ' - 'log message.'), -] - -CONF = cfg.CONF -CONF.register_cli_opts(common_cli_opts) -CONF.register_cli_opts(logging_cli_opts) -CONF.register_opts(generic_log_opts) -CONF.register_opts(log_opts) - - -def list_opts(): - """Entry point for oslo.config-generator.""" - return [(None, copy.deepcopy(common_cli_opts)), - (None, copy.deepcopy(logging_cli_opts)), - (None, copy.deepcopy(generic_log_opts)), - (None, copy.deepcopy(log_opts)), - ] - - -# our new audit level -# NOTE(jkoelker) Since we synthesized an audit level, make the logging -# module aware of it so it acts like other levels. -logging.AUDIT = logging.INFO + 1 -logging.addLevelName(logging.AUDIT, 'AUDIT') - - -try: - NullHandler = logging.NullHandler -except AttributeError: # NOTE(jkoelker) NullHandler added in Python 2.7 - class NullHandler(logging.Handler): - def handle(self, record): - pass - - def emit(self, record): - pass - - def createLock(self): - self.lock = None - - -def _dictify_context(context): - if context is None: - return None - if not isinstance(context, dict) and getattr(context, 'to_dict', None): - context = context.to_dict() - return context - - -def _get_binary_name(): - return os.path.basename(inspect.stack()[-1][1]) - - -def _get_log_file_path(binary=None): - logfile = CONF.log_file - logdir = CONF.log_dir - - if logfile and not logdir: - return logfile - - if logfile and logdir: - return os.path.join(logdir, logfile) - - if logdir: - binary = binary or _get_binary_name() - return '%s.log' % (os.path.join(logdir, binary),) - - return None - - -class BaseLoggerAdapter(logging.LoggerAdapter): - - def audit(self, msg, *args, **kwargs): - self.log(logging.AUDIT, msg, *args, **kwargs) - - def isEnabledFor(self, level): - if _PY26: - # This method was added in python 2.7 (and it does the exact - # same logic, so we need to do the exact same logic so that - # python 2.6 has this capability as well). - return self.logger.isEnabledFor(level) - else: - return super(BaseLoggerAdapter, self).isEnabledFor(level) - - -class LazyAdapter(BaseLoggerAdapter): - def __init__(self, name='unknown', version='unknown'): - self._logger = None - self.extra = {} - self.name = name - self.version = version - - @property - def logger(self): - if not self._logger: - self._logger = getLogger(self.name, self.version) - if six.PY3: - # In Python 3, the code fails because the 'manager' attribute - # cannot be found when using a LoggerAdapter as the - # underlying logger. Work around this issue. - self._logger.manager = self._logger.logger.manager - return self._logger - - -class ContextAdapter(BaseLoggerAdapter): - warn = logging.LoggerAdapter.warning - - def __init__(self, logger, project_name, version_string): - self.logger = logger - self.project = project_name - self.version = version_string - self._deprecated_messages_sent = dict() - - @property - def handlers(self): - return self.logger.handlers - - def deprecated(self, msg, *args, **kwargs): - """Call this method when a deprecated feature is used. - - If the system is configured for fatal deprecations then the message - is logged at the 'critical' level and :class:`DeprecatedConfig` will - be raised. - - Otherwise, the message will be logged (once) at the 'warn' level. - - :raises: :class:`DeprecatedConfig` if the system is configured for - fatal deprecations. - - """ - stdmsg = _("Deprecated: %s") % msg - if CONF.fatal_deprecations: - self.critical(stdmsg, *args, **kwargs) - raise DeprecatedConfig(msg=stdmsg) - - # Using a list because a tuple with dict can't be stored in a set. - sent_args = self._deprecated_messages_sent.setdefault(msg, list()) - - if args in sent_args: - # Already logged this message, so don't log it again. - return - - sent_args.append(args) - self.warn(stdmsg, *args, **kwargs) - - def process(self, msg, kwargs): - # NOTE(jecarey): If msg is not unicode, coerce it into unicode - # before it can get to the python logging and - # possibly cause string encoding trouble - if not isinstance(msg, six.text_type): - msg = six.text_type(msg) - - if 'extra' not in kwargs: - kwargs['extra'] = {} - extra = kwargs['extra'] - - context = kwargs.pop('context', None) - if not context: - context = getattr(local.store, 'context', None) - if context: - extra.update(_dictify_context(context)) - - instance = kwargs.pop('instance', None) - instance_uuid = (extra.get('instance_uuid') or - kwargs.pop('instance_uuid', None)) - instance_extra = '' - if instance: - instance_extra = CONF.instance_format % instance - elif instance_uuid: - instance_extra = (CONF.instance_uuid_format - % {'uuid': instance_uuid}) - extra['instance'] = instance_extra - - extra.setdefault('user_identity', kwargs.pop('user_identity', None)) - - extra['project'] = self.project - extra['version'] = self.version - extra['extra'] = extra.copy() - return msg, kwargs - - -class JSONFormatter(logging.Formatter): - def __init__(self, fmt=None, datefmt=None): - # NOTE(jkoelker) we ignore the fmt argument, but its still there - # since logging.config.fileConfig passes it. - self.datefmt = datefmt - - def formatException(self, ei, strip_newlines=True): - lines = traceback.format_exception(*ei) - if strip_newlines: - lines = [moves.filter( - lambda x: x, - line.rstrip().splitlines()) for line in lines] - lines = list(itertools.chain(*lines)) - return lines - - def format(self, record): - message = {'message': record.getMessage(), - 'asctime': self.formatTime(record, self.datefmt), - 'name': record.name, - 'msg': record.msg, - 'args': record.args, - 'levelname': record.levelname, - 'levelno': record.levelno, - 'pathname': record.pathname, - 'filename': record.filename, - 'module': record.module, - 'lineno': record.lineno, - 'funcname': record.funcName, - 'created': record.created, - 'msecs': record.msecs, - 'relative_created': record.relativeCreated, - 'thread': record.thread, - 'thread_name': record.threadName, - 'process_name': record.processName, - 'process': record.process, - 'traceback': None} - - if hasattr(record, 'extra'): - message['extra'] = record.extra - - if record.exc_info: - message['traceback'] = self.formatException(record.exc_info) - - return jsonutils.dumps(message) - - -def _create_logging_excepthook(product_name): - def logging_excepthook(exc_type, value, tb): - extra = {'exc_info': (exc_type, value, tb)} - getLogger(product_name).critical( - "".join(traceback.format_exception_only(exc_type, value)), - **extra) - return logging_excepthook - - -class LogConfigError(Exception): - - message = _('Error loading logging config %(log_config)s: %(err_msg)s') - - def __init__(self, log_config, err_msg): - self.log_config = log_config - self.err_msg = err_msg - - def __str__(self): - return self.message % dict(log_config=self.log_config, - err_msg=self.err_msg) - - -def _load_log_config(log_config_append): - try: - logging.config.fileConfig(log_config_append, - disable_existing_loggers=False) - except (moves.configparser.Error, KeyError) as exc: - raise LogConfigError(log_config_append, six.text_type(exc)) - - -def setup(product_name, version='unknown'): - """Setup logging.""" - if CONF.log_config_append: - _load_log_config(CONF.log_config_append) - else: - _setup_logging_from_conf(product_name, version) - sys.excepthook = _create_logging_excepthook(product_name) - - -def set_defaults(logging_context_format_string=None, - default_log_levels=None): - # Just in case the caller is not setting the - # default_log_level. This is insurance because - # we introduced the default_log_level parameter - # later in a backwards in-compatible change - if default_log_levels is not None: - cfg.set_defaults( - log_opts, - default_log_levels=default_log_levels) - if logging_context_format_string is not None: - cfg.set_defaults( - log_opts, - logging_context_format_string=logging_context_format_string) - - -def _find_facility_from_conf(): - facility_names = logging.handlers.SysLogHandler.facility_names - facility = getattr(logging.handlers.SysLogHandler, - CONF.syslog_log_facility, - None) - - if facility is None and CONF.syslog_log_facility in facility_names: - facility = facility_names.get(CONF.syslog_log_facility) - - if facility is None: - valid_facilities = facility_names.keys() - consts = ['LOG_AUTH', 'LOG_AUTHPRIV', 'LOG_CRON', 'LOG_DAEMON', - 'LOG_FTP', 'LOG_KERN', 'LOG_LPR', 'LOG_MAIL', 'LOG_NEWS', - 'LOG_AUTH', 'LOG_SYSLOG', 'LOG_USER', 'LOG_UUCP', - 'LOG_LOCAL0', 'LOG_LOCAL1', 'LOG_LOCAL2', 'LOG_LOCAL3', - 'LOG_LOCAL4', 'LOG_LOCAL5', 'LOG_LOCAL6', 'LOG_LOCAL7'] - valid_facilities.extend(consts) - raise TypeError(_('syslog facility must be one of: %s') % - ', '.join("'%s'" % fac - for fac in valid_facilities)) - - return facility - - -class RFCSysLogHandler(logging.handlers.SysLogHandler): - def __init__(self, *args, **kwargs): - self.binary_name = _get_binary_name() - # Do not use super() unless type(logging.handlers.SysLogHandler) - # is 'type' (Python 2.7). - # Use old style calls, if the type is 'classobj' (Python 2.6) - logging.handlers.SysLogHandler.__init__(self, *args, **kwargs) - - def format(self, record): - # Do not use super() unless type(logging.handlers.SysLogHandler) - # is 'type' (Python 2.7). - # Use old style calls, if the type is 'classobj' (Python 2.6) - msg = logging.handlers.SysLogHandler.format(self, record) - msg = self.binary_name + ' ' + msg - return msg - - -def _setup_logging_from_conf(project, version): - log_root = getLogger(None).logger - for handler in log_root.handlers: - log_root.removeHandler(handler) - - logpath = _get_log_file_path() - if logpath: - filelog = logging.handlers.WatchedFileHandler(logpath) - log_root.addHandler(filelog) - - if CONF.use_stderr: - streamlog = ColorHandler() - log_root.addHandler(streamlog) - - elif not logpath: - # pass sys.stdout as a positional argument - # python2.6 calls the argument strm, in 2.7 it's stream - streamlog = logging.StreamHandler(sys.stdout) - log_root.addHandler(streamlog) - - if CONF.publish_errors: - handler = importutils.import_object( - "oslo.messaging.notify.log_handler.PublishErrorsHandler", - logging.ERROR) - log_root.addHandler(handler) - - datefmt = CONF.log_date_format - for handler in log_root.handlers: - # NOTE(alaski): CONF.log_format overrides everything currently. This - # should be deprecated in favor of context aware formatting. - if CONF.log_format: - handler.setFormatter(logging.Formatter(fmt=CONF.log_format, - datefmt=datefmt)) - log_root.info('Deprecated: log_format is now deprecated and will ' - 'be removed in the next release') - else: - handler.setFormatter(ContextFormatter(project=project, - version=version, - datefmt=datefmt)) - - if CONF.debug: - log_root.setLevel(logging.DEBUG) - elif CONF.verbose: - log_root.setLevel(logging.INFO) - else: - log_root.setLevel(logging.WARNING) - - for pair in CONF.default_log_levels: - mod, _sep, level_name = pair.partition('=') - logger = logging.getLogger(mod) - # NOTE(AAzza) in python2.6 Logger.setLevel doesn't convert string name - # to integer code. - if sys.version_info < (2, 7): - level = logging.getLevelName(level_name) - logger.setLevel(level) - else: - logger.setLevel(level_name) - - if CONF.use_syslog: - try: - facility = _find_facility_from_conf() - # TODO(bogdando) use the format provided by RFCSysLogHandler - # after existing syslog format deprecation in J - if CONF.use_syslog_rfc_format: - syslog = RFCSysLogHandler(address='/dev/log', - facility=facility) - else: - syslog = logging.handlers.SysLogHandler(address='/dev/log', - facility=facility) - log_root.addHandler(syslog) - except socket.error: - log_root.error('Unable to add syslog handler. Verify that syslog ' - 'is running.') - - -_loggers = {} - - -def getLogger(name='unknown', version='unknown'): - if name not in _loggers: - _loggers[name] = ContextAdapter(logging.getLogger(name), - name, - version) - return _loggers[name] - - -def getLazyLogger(name='unknown', version='unknown'): - """Returns lazy logger. - - Creates a pass-through logger that does not create the real logger - until it is really needed and delegates all calls to the real logger - once it is created. - """ - return LazyAdapter(name, version) - - -class WritableLogger(object): - """A thin wrapper that responds to `write` and logs.""" - - def __init__(self, logger, level=logging.INFO): - self.logger = logger - self.level = level - - def write(self, msg): - self.logger.log(self.level, msg.rstrip()) - - -class ContextFormatter(logging.Formatter): - """A context.RequestContext aware formatter configured through flags. - - The flags used to set format strings are: logging_context_format_string - and logging_default_format_string. You can also specify - logging_debug_format_suffix to append extra formatting if the log level is - debug. - - For information about what variables are available for the formatter see: - http://docs.python.org/library/logging.html#formatter - - If available, uses the context value stored in TLS - local.store.context - - """ - - def __init__(self, *args, **kwargs): - """Initialize ContextFormatter instance - - Takes additional keyword arguments which can be used in the message - format string. - - :keyword project: project name - :type project: string - :keyword version: project version - :type version: string - - """ - - self.project = kwargs.pop('project', 'unknown') - self.version = kwargs.pop('version', 'unknown') - - logging.Formatter.__init__(self, *args, **kwargs) - - def format(self, record): - """Uses contextstring if request_id is set, otherwise default.""" - - # NOTE(jecarey): If msg is not unicode, coerce it into unicode - # before it can get to the python logging and - # possibly cause string encoding trouble - if not isinstance(record.msg, six.text_type): - record.msg = six.text_type(record.msg) - - # store project info - record.project = self.project - record.version = self.version - - # store request info - context = getattr(local.store, 'context', None) - if context: - d = _dictify_context(context) - for k, v in d.items(): - setattr(record, k, v) - - # NOTE(sdague): default the fancier formatting params - # to an empty string so we don't throw an exception if - # they get used - for key in ('instance', 'color', 'user_identity'): - if key not in record.__dict__: - record.__dict__[key] = '' - - if record.__dict__.get('request_id'): - fmt = CONF.logging_context_format_string - else: - fmt = CONF.logging_default_format_string - - if (record.levelno == logging.DEBUG and - CONF.logging_debug_format_suffix): - fmt += " " + CONF.logging_debug_format_suffix - - if sys.version_info < (3, 2): - self._fmt = fmt - else: - self._style = logging.PercentStyle(fmt) - self._fmt = self._style._fmt - # Cache this on the record, Logger will respect our formatted copy - if record.exc_info: - record.exc_text = self.formatException(record.exc_info, record) - return logging.Formatter.format(self, record) - - def formatException(self, exc_info, record=None): - """Format exception output with CONF.logging_exception_prefix.""" - if not record: - return logging.Formatter.formatException(self, exc_info) - - stringbuffer = moves.StringIO() - traceback.print_exception(exc_info[0], exc_info[1], exc_info[2], - None, stringbuffer) - lines = stringbuffer.getvalue().split('\n') - stringbuffer.close() - - if CONF.logging_exception_prefix.find('%(asctime)') != -1: - record.asctime = self.formatTime(record, self.datefmt) - - formatted_lines = [] - for line in lines: - pl = CONF.logging_exception_prefix % record.__dict__ - fl = '%s%s' % (pl, line) - formatted_lines.append(fl) - return '\n'.join(formatted_lines) - - -class ColorHandler(logging.StreamHandler): - LEVEL_COLORS = { - logging.DEBUG: '\033[00;32m', # GREEN - logging.INFO: '\033[00;36m', # CYAN - logging.AUDIT: '\033[01;36m', # BOLD CYAN - logging.WARN: '\033[01;33m', # BOLD YELLOW - logging.ERROR: '\033[01;31m', # BOLD RED - logging.CRITICAL: '\033[01;31m', # BOLD RED - } - - def format(self, record): - record.color = self.LEVEL_COLORS[record.levelno] - return logging.StreamHandler.format(self, record) - - -class DeprecatedConfig(Exception): - message = _("Fatal call to deprecated config: %(msg)s") - - def __init__(self, msg): - super(Exception, self).__init__(self.message % dict(msg=msg)) diff --git a/cinder/openstack/common/log_handler.py b/cinder/openstack/common/log_handler.py deleted file mode 100644 index dcda5db2d..000000000 --- a/cinder/openstack/common/log_handler.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2013 IBM Corp. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -import logging - -from oslo.config import cfg - -from cinder import rpc - - -class PublishErrorsHandler(logging.Handler): - def emit(self, record): - # NOTE(flaper87): This will have to be changed in the - # future. Leaving for backwar compatibility - if ('cinder.openstack.common.notifier.log_notifier' in - cfg.CONF.notification_driver): - return - msg = record.getMessage() - rpc.get_notifier('error.publisher').error(None, 'error_notification', - dict(error=msg)) diff --git a/cinder/quota.py b/cinder/quota.py index d8ae0ad48..7b65a0e74 100644 --- a/cinder/quota.py +++ b/cinder/quota.py @@ -20,6 +20,7 @@ import datetime from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import importutils from oslo_utils import timeutils @@ -27,7 +28,7 @@ from cinder import context from cinder import db from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging +from cinder.openstack.common import versionutils LOG = logging.getLogger(__name__) @@ -115,11 +116,12 @@ class DbQuotaDriver(object): for resource in resources.values(): if resource.name not in default_quotas: - LOG.deprecated(_("Default quota for resource: %(res)s is set " - "by the default quota flag: quota_%(res)s, " - "it is now deprecated. Please use the " - "default quota class for default " - "quota.") % {'res': resource.name}) + versionutils.report_deprecated_feature(LOG, _( + "Default quota for resource: %(res)s is set " + "by the default quota flag: quota_%(res)s, " + "it is now deprecated. Please use the " + "default quota class for default " + "quota.") % {'res': resource.name}) quotas[resource.name] = default_quotas.get(resource.name, resource.default) diff --git a/cinder/quota_utils.py b/cinder/quota_utils.py index da07cf81e..32c06c985 100644 --- a/cinder/quota_utils.py +++ b/cinder/quota_utils.py @@ -13,9 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging + from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import quota diff --git a/cinder/replication/api.py b/cinder/replication/api.py index 49d9fa3d0..199dbd0e5 100644 --- a/cinder/replication/api.py +++ b/cinder/replication/api.py @@ -18,11 +18,11 @@ Handles all requests relating to volume replication. import functools from oslo_config import cfg +from oslo_log import log as logging from cinder.db import base from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import policy from cinder import volume as cinder_volume from cinder.volume import rpcapi as volume_rpcapi diff --git a/cinder/scheduler/filter_scheduler.py b/cinder/scheduler/filter_scheduler.py index 52eb1ec33..d84ad48b3 100644 --- a/cinder/scheduler/filter_scheduler.py +++ b/cinder/scheduler/filter_scheduler.py @@ -21,10 +21,10 @@ Weighing Functions. """ from oslo_config import cfg +from oslo_log import log as logging from cinder import exception from cinder.i18n import _, _LW -from cinder.openstack.common import log as logging from cinder.scheduler import driver from cinder.scheduler import scheduler_options from cinder.volume import utils diff --git a/cinder/scheduler/filters/affinity_filter.py b/cinder/scheduler/filters/affinity_filter.py index 68906d068..c55e54870 100644 --- a/cinder/scheduler/filters/affinity_filter.py +++ b/cinder/scheduler/filters/affinity_filter.py @@ -13,9 +13,10 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +from oslo_log import log as logging from oslo_utils import uuidutils -from cinder.openstack.common import log as logging from cinder.openstack.common.scheduler import filters from cinder.volume import api as volume diff --git a/cinder/scheduler/filters/capacity_filter.py b/cinder/scheduler/filters/capacity_filter.py index fb72d8536..9d377bf62 100644 --- a/cinder/scheduler/filters/capacity_filter.py +++ b/cinder/scheduler/filters/capacity_filter.py @@ -19,8 +19,9 @@ import math +from oslo_log import log as logging + from cinder.i18n import _LE, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common.scheduler import filters diff --git a/cinder/scheduler/filters/driver_filter.py b/cinder/scheduler/filters/driver_filter.py index f7b09a20b..ac6fe7b0a 100644 --- a/cinder/scheduler/filters/driver_filter.py +++ b/cinder/scheduler/filters/driver_filter.py @@ -13,10 +13,10 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging import six from cinder.i18n import _LW -from cinder.openstack.common import log as logging from cinder.openstack.common.scheduler import filters from cinder.scheduler.evaluator import evaluator diff --git a/cinder/scheduler/filters/instance_locality_filter.py b/cinder/scheduler/filters/instance_locality_filter.py index 2730e14ec..6046f9440 100644 --- a/cinder/scheduler/filters/instance_locality_filter.py +++ b/cinder/scheduler/filters/instance_locality_filter.py @@ -12,12 +12,13 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + +from oslo_log import log as logging from oslo_utils import uuidutils from cinder.compute import nova from cinder import exception from cinder.i18n import _, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common.scheduler import filters from cinder.volume import utils as volume_utils diff --git a/cinder/scheduler/flows/create_volume.py b/cinder/scheduler/flows/create_volume.py index 4e55d4d1a..bfeb27758 100644 --- a/cinder/scheduler/flows/create_volume.py +++ b/cinder/scheduler/flows/create_volume.py @@ -10,6 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from oslo_utils import excutils import taskflow.engines from taskflow.patterns import linear_flow @@ -17,7 +18,6 @@ from taskflow.patterns import linear_flow from cinder import exception from cinder import flow_utils from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder import rpc from cinder import utils from cinder.volume.flows import common diff --git a/cinder/scheduler/host_manager.py b/cinder/scheduler/host_manager.py index 3637600b9..1b8d1d1d3 100644 --- a/cinder/scheduler/host_manager.py +++ b/cinder/scheduler/host_manager.py @@ -20,12 +20,12 @@ Manage hosts in the current zone. import UserDict from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import timeutils from cinder import db from cinder import exception from cinder.i18n import _LI, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common.scheduler import filters from cinder.openstack.common.scheduler import weights from cinder import utils diff --git a/cinder/scheduler/manager.py b/cinder/scheduler/manager.py index c07a1268a..9c91e10cc 100644 --- a/cinder/scheduler/manager.py +++ b/cinder/scheduler/manager.py @@ -20,6 +20,7 @@ Scheduler Service """ from oslo_config import cfg +from oslo_log import log as logging import oslo_messaging as messaging from oslo_utils import excutils from oslo_utils import importutils @@ -30,7 +31,7 @@ from cinder import exception from cinder import flow_utils from cinder.i18n import _, _LE from cinder import manager -from cinder.openstack.common import log as logging +from cinder.openstack.common import versionutils from cinder import quota from cinder import rpc from cinder.scheduler.flows import create_volume @@ -65,12 +66,13 @@ class SchedulerManager(manager.Manager): 'cinder.scheduler.simple.SimpleScheduler']: scheduler_driver = ('cinder.scheduler.filter_scheduler.' 'FilterScheduler') - LOG.deprecated(_('ChanceScheduler and SimpleScheduler have been ' - 'deprecated due to lack of support for advanced ' - 'features like: volume types, volume encryption,' - ' QoS etc. These two schedulers can be fully ' - 'replaced by FilterScheduler with certain ' - 'combination of filters and weighers.')) + versionutils.report_deprecated_feature(LOG, _( + 'ChanceScheduler and SimpleScheduler have been ' + 'deprecated due to lack of support for advanced ' + 'features like: volume types, volume encryption,' + ' QoS etc. These two schedulers can be fully ' + 'replaced by FilterScheduler with certain ' + 'combination of filters and weighers.')) self.driver = importutils.import_object(scheduler_driver) super(SchedulerManager, self).__init__(*args, **kwargs) diff --git a/cinder/scheduler/scheduler_options.py b/cinder/scheduler/scheduler_options.py index a70218058..9902e4994 100644 --- a/cinder/scheduler/scheduler_options.py +++ b/cinder/scheduler/scheduler_options.py @@ -25,10 +25,10 @@ import json import os from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import timeutils from cinder.i18n import _LE -from cinder.openstack.common import log as logging scheduler_json_config_location_opt = cfg.StrOpt( diff --git a/cinder/scheduler/weights/goodness.py b/cinder/scheduler/weights/goodness.py index 9b4316cef..fa6fc0959 100644 --- a/cinder/scheduler/weights/goodness.py +++ b/cinder/scheduler/weights/goodness.py @@ -12,10 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging import six from cinder.i18n import _LW -from cinder.openstack.common import log as logging from cinder.openstack.common.scheduler import weights from cinder.scheduler.evaluator import evaluator diff --git a/cinder/scheduler/weights/volume_number.py b/cinder/scheduler/weights/volume_number.py index 642b71672..3fe7b5417 100644 --- a/cinder/scheduler/weights/volume_number.py +++ b/cinder/scheduler/weights/volume_number.py @@ -24,9 +24,9 @@ number and the weighing has the opposite effect of the default. from oslo_config import cfg +from oslo_log import log as logging from cinder import db -from cinder.openstack.common import log as logging from cinder.openstack.common.scheduler import weights diff --git a/cinder/service.py b/cinder/service.py index 4d74db81c..0a87448ba 100644 --- a/cinder/service.py +++ b/cinder/service.py @@ -25,6 +25,7 @@ import random from oslo_concurrency import processutils from oslo_config import cfg from oslo_db import exception as db_exc +from oslo_log import log as logging import oslo_messaging as messaging from oslo_utils import importutils import osprofiler.notifier @@ -36,7 +37,6 @@ from cinder import db from cinder import exception from cinder.i18n import _ from cinder.objects import base as objects_base -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder.openstack.common import service from cinder import rpc diff --git a/cinder/ssh_utils.py b/cinder/ssh_utils.py index 5ce4b1cf2..f53ebabd6 100644 --- a/cinder/ssh_utils.py +++ b/cinder/ssh_utils.py @@ -23,11 +23,11 @@ import string from eventlet import pools from oslo_config import cfg +from oslo_log import log as logging import paramiko from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/test.py b/cinder/test.py index 0bd74584d..090d8a9cf 100644 --- a/cinder/test.py +++ b/cinder/test.py @@ -32,6 +32,7 @@ import mox from oslo_concurrency import lockutils from oslo_config import cfg from oslo_config import fixture as config_fixture +from oslo_log import log from oslo_messaging import conffixture as messaging_conffixture from oslo_utils import strutils from oslo_utils import timeutils @@ -43,7 +44,6 @@ from cinder.db import migration from cinder.db.sqlalchemy import api as sqla_api from cinder import i18n from cinder import objects -from cinder.openstack.common import log as oslo_logging from cinder import rpc from cinder import service from cinder.tests import conf_fixture @@ -57,7 +57,7 @@ test_opts = [ CONF = cfg.CONF CONF.register_opts(test_opts) -LOG = oslo_logging.getLogger(__name__) +LOG = log.getLogger(__name__) _DB_CACHE = None diff --git a/cinder/tests/api/contrib/test_backups.py b/cinder/tests/api/contrib/test_backups.py index 4fd465d50..1fe3752ee 100644 --- a/cinder/tests/api/contrib/test_backups.py +++ b/cinder/tests/api/contrib/test_backups.py @@ -21,6 +21,7 @@ import json from xml.dom import minidom import mock +from oslo_log import log as logging from oslo_utils import timeutils import webob @@ -30,7 +31,6 @@ from cinder import context from cinder import db from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import test from cinder.tests.api import fakes from cinder.tests import utils diff --git a/cinder/tests/api/contrib/test_cgsnapshots.py b/cinder/tests/api/contrib/test_cgsnapshots.py index 3ecef8576..4654ceef6 100644 --- a/cinder/tests/api/contrib/test_cgsnapshots.py +++ b/cinder/tests/api/contrib/test_cgsnapshots.py @@ -21,13 +21,13 @@ import json from xml.dom import minidom import mock +from oslo_log import log as logging import webob from cinder.consistencygroup import api as consistencygroupAPI from cinder import context from cinder import db from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.tests.api import fakes from cinder.tests import utils diff --git a/cinder/tests/api/contrib/test_hosts.py b/cinder/tests/api/contrib/test_hosts.py index d0208971a..139842663 100644 --- a/cinder/tests/api/contrib/test_hosts.py +++ b/cinder/tests/api/contrib/test_hosts.py @@ -16,13 +16,13 @@ import datetime from lxml import etree +from oslo_log import log as logging from oslo_utils import timeutils import webob.exc from cinder.api.contrib import hosts as os_hosts from cinder import context from cinder import db -from cinder.openstack.common import log as logging from cinder import test diff --git a/cinder/tests/api/contrib/test_volume_transfer.py b/cinder/tests/api/contrib/test_volume_transfer.py index f850bf2a5..0b541e166 100644 --- a/cinder/tests/api/contrib/test_volume_transfer.py +++ b/cinder/tests/api/contrib/test_volume_transfer.py @@ -20,13 +20,13 @@ Tests for volume transfer code. import json from xml.dom import minidom +from oslo_log import log as logging import webob from cinder.api.contrib import volume_transfer from cinder import context from cinder import db from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.tests.api import fakes from cinder import transfer diff --git a/cinder/tests/api/test_router.py b/cinder/tests/api/test_router.py index 48747a86f..e38a62a5e 100644 --- a/cinder/tests/api/test_router.py +++ b/cinder/tests/api/test_router.py @@ -13,13 +13,13 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from cinder.api.openstack import wsgi from cinder.api.v1 import router from cinder.api.v1 import snapshots from cinder.api.v1 import volumes from cinder.api import versions -from cinder.openstack.common import log as logging from cinder import test from cinder.tests.api import fakes diff --git a/cinder/tests/api/v1/test_snapshots.py b/cinder/tests/api/v1/test_snapshots.py index 395f49ca6..476a7a5ec 100644 --- a/cinder/tests/api/v1/test_snapshots.py +++ b/cinder/tests/api/v1/test_snapshots.py @@ -17,13 +17,13 @@ import datetime from lxml import etree import mock +from oslo_log import log as logging import webob from cinder.api.v1 import snapshots from cinder import context from cinder import db from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.tests.api import fakes from cinder.tests.api.v1 import stubs diff --git a/cinder/tests/api/v2/test_snapshots.py b/cinder/tests/api/v2/test_snapshots.py index fc9238c97..77c7ffee9 100644 --- a/cinder/tests/api/v2/test_snapshots.py +++ b/cinder/tests/api/v2/test_snapshots.py @@ -17,13 +17,13 @@ import datetime from lxml import etree import mock +from oslo_log import log as logging import webob from cinder.api.v2 import snapshots from cinder import context from cinder import db from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.tests.api import fakes from cinder.tests.api.v2 import stubs diff --git a/cinder/tests/backup/drivers/test_backup_nfs.py b/cinder/tests/backup/drivers/test_backup_nfs.py index 41cf29f98..973a4ba13 100644 --- a/cinder/tests/backup/drivers/test_backup_nfs.py +++ b/cinder/tests/backup/drivers/test_backup_nfs.py @@ -28,6 +28,7 @@ import zlib import mock from oslo_config import cfg +from oslo_log import log as logging from cinder.backup.drivers import nfs from cinder.brick.remotefs import remotefs as remotefs_brick @@ -35,7 +36,6 @@ from cinder import context from cinder import db from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import test from cinder import utils diff --git a/cinder/tests/backup/fake_service.py b/cinder/tests/backup/fake_service.py index 1f65445a5..7895cc3a4 100644 --- a/cinder/tests/backup/fake_service.py +++ b/cinder/tests/backup/fake_service.py @@ -13,8 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging + from cinder.backup import driver -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/tests/backup/fake_service_with_verify.py b/cinder/tests/backup/fake_service_with_verify.py index f88069fb3..8f7821c5e 100644 --- a/cinder/tests/backup/fake_service_with_verify.py +++ b/cinder/tests/backup/fake_service_with_verify.py @@ -13,8 +13,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging + from cinder.backup import driver -from cinder.openstack.common import log as logging from cinder.tests.backup import fake_service LOG = logging.getLogger(__name__) diff --git a/cinder/tests/backup/fake_swift_client.py b/cinder/tests/backup/fake_swift_client.py index ff75bd291..86d2925c9 100644 --- a/cinder/tests/backup/fake_swift_client.py +++ b/cinder/tests/backup/fake_swift_client.py @@ -19,10 +19,9 @@ import os import socket import zlib +from oslo_log import log as logging from swiftclient import client as swift -from cinder.openstack.common import log as logging - LOG = logging.getLogger(__name__) diff --git a/cinder/tests/backup/fake_swift_client2.py b/cinder/tests/backup/fake_swift_client2.py index 10f63759c..2572549fa 100644 --- a/cinder/tests/backup/fake_swift_client2.py +++ b/cinder/tests/backup/fake_swift_client2.py @@ -20,10 +20,10 @@ import os import socket import tempfile +from oslo_log import log as logging from swiftclient import client as swift from cinder.openstack.common import fileutils -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/tests/brick/fake_lvm.py b/cinder/tests/brick/fake_lvm.py index cadb3d80e..2bfb79807 100644 --- a/cinder/tests/brick/fake_lvm.py +++ b/cinder/tests/brick/fake_lvm.py @@ -10,7 +10,7 @@ # License for the specific language governing permissions and limitations # under the License. -from cinder.openstack.common import log as logging +from oslo_log import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/tests/brick/test_brick_connector.py b/cinder/tests/brick/test_brick_connector.py index 7daee4904..61b59f890 100644 --- a/cinder/tests/brick/test_brick_connector.py +++ b/cinder/tests/brick/test_brick_connector.py @@ -21,13 +21,13 @@ import time import mock from oslo_concurrency import processutils as putils from oslo_config import cfg +from oslo_log import log as logging from cinder.brick import exception from cinder.brick.initiator import connector from cinder.brick.initiator import host_driver from cinder.brick.initiator import linuxfc from cinder.i18n import _LE -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder import test diff --git a/cinder/tests/brick/test_brick_linuxfc.py b/cinder/tests/brick/test_brick_linuxfc.py index 55de4fdfc..939f24b2f 100644 --- a/cinder/tests/brick/test_brick_linuxfc.py +++ b/cinder/tests/brick/test_brick_linuxfc.py @@ -15,8 +15,9 @@ import os.path import string +from oslo_log import log as logging + from cinder.brick.initiator import linuxfc -from cinder.openstack.common import log as logging from cinder import test LOG = logging.getLogger(__name__) diff --git a/cinder/tests/brick/test_brick_linuxscsi.py b/cinder/tests/brick/test_brick_linuxscsi.py index fcea805a2..ed08d7fe7 100644 --- a/cinder/tests/brick/test_brick_linuxscsi.py +++ b/cinder/tests/brick/test_brick_linuxscsi.py @@ -15,8 +15,9 @@ import os.path import string +from oslo_log import log as logging + from cinder.brick.initiator import linuxscsi -from cinder.openstack.common import log as logging from cinder import test LOG = logging.getLogger(__name__) diff --git a/cinder/tests/brick/test_brick_lvm.py b/cinder/tests/brick/test_brick_lvm.py index d30ccffa5..69390898a 100644 --- a/cinder/tests/brick/test_brick_lvm.py +++ b/cinder/tests/brick/test_brick_lvm.py @@ -15,10 +15,10 @@ import mox from oslo_concurrency import processutils +from oslo_log import log as logging from cinder.brick import exception from cinder.brick.local_dev import lvm as brick -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf diff --git a/cinder/tests/brick/test_brick_remotefs.py b/cinder/tests/brick/test_brick_remotefs.py index 9af722a56..0b8a8af27 100644 --- a/cinder/tests/brick/test_brick_remotefs.py +++ b/cinder/tests/brick/test_brick_remotefs.py @@ -15,11 +15,11 @@ import mock import mox +from oslo_log import log as logging from cinder.brick import exception from cinder.brick.remotefs import remotefs from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import test LOG = logging.getLogger(__name__) diff --git a/cinder/tests/db/test_purge.py b/cinder/tests/db/test_purge.py index a9ca8c29b..e051bc403 100644 --- a/cinder/tests/db/test_purge.py +++ b/cinder/tests/db/test_purge.py @@ -18,11 +18,12 @@ import datetime import uuid +from oslo_log import log as logging + from cinder import context from cinder import db from cinder.db.sqlalchemy import api as db_api from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from oslo_db.sqlalchemy import utils as sqlalchemyutils diff --git a/cinder/tests/db/test_qos_specs.py b/cinder/tests/db/test_qos_specs.py index 02304bb2a..0fb6c59ae 100644 --- a/cinder/tests/db/test_qos_specs.py +++ b/cinder/tests/db/test_qos_specs.py @@ -19,10 +19,11 @@ import time +from oslo_log import log as logging + from cinder import context from cinder import db from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import volume_types diff --git a/cinder/tests/db/test_transfers.py b/cinder/tests/db/test_transfers.py index 74b25f524..6ad8b98cb 100644 --- a/cinder/tests/db/test_transfers.py +++ b/cinder/tests/db/test_transfers.py @@ -15,10 +15,11 @@ """Tests for transfers table.""" +from oslo_log import log as logging + from cinder import context from cinder import db from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.tests import utils diff --git a/cinder/tests/fake_driver.py b/cinder/tests/fake_driver.py index e554c6aee..2c1b0351c 100644 --- a/cinder/tests/fake_driver.py +++ b/cinder/tests/fake_driver.py @@ -12,8 +12,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging + from cinder.i18n import _LE -from cinder.openstack.common import log as logging from cinder.tests.brick import fake_lvm from cinder.volume import driver from cinder.volume.drivers import lvm diff --git a/cinder/tests/fake_utils.py b/cinder/tests/fake_utils.py index 4d1571377..26b5cba07 100644 --- a/cinder/tests/fake_utils.py +++ b/cinder/tests/fake_utils.py @@ -18,8 +18,8 @@ import re from eventlet import greenthread from oslo_concurrency import processutils +from oslo_log import log as logging -from cinder.openstack.common import log as logging from cinder import utils LOG = logging.getLogger(__name__) diff --git a/cinder/tests/image/fake.py b/cinder/tests/image/fake.py index de1903eb8..b3cf50cc9 100644 --- a/cinder/tests/image/fake.py +++ b/cinder/tests/image/fake.py @@ -20,9 +20,10 @@ import copy import datetime import uuid +from oslo_log import log as logging + from cinder import exception import cinder.image.glance -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/tests/integrated/api/client.py b/cinder/tests/integrated/api/client.py index 73acf9c10..4ed2b9570 100644 --- a/cinder/tests/integrated/api/client.py +++ b/cinder/tests/integrated/api/client.py @@ -12,13 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from oslo_serialization import jsonutils from oslo_utils import netutils import requests import six.moves.urllib.parse as urlparse from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/tests/integrated/integrated_helpers.py b/cinder/tests/integrated/integrated_helpers.py index 118650ddb..70ed6c18f 100644 --- a/cinder/tests/integrated/integrated_helpers.py +++ b/cinder/tests/integrated/integrated_helpers.py @@ -22,8 +22,8 @@ import string import uuid import fixtures +from oslo_log import log as logging -from cinder.openstack.common import log as logging from cinder import service from cinder import test # For the flags from cinder.tests.integrated.api import client diff --git a/cinder/tests/integrated/test_extensions.py b/cinder/tests/integrated/test_extensions.py index b27f45b60..1e140143c 100644 --- a/cinder/tests/integrated/test_extensions.py +++ b/cinder/tests/integrated/test_extensions.py @@ -15,8 +15,8 @@ from oslo_config import cfg +from oslo_log import log as logging -from cinder.openstack.common import log as logging from cinder.tests.integrated import integrated_helpers diff --git a/cinder/tests/integrated/test_login.py b/cinder/tests/integrated/test_login.py index d89d482bd..e0bad0957 100644 --- a/cinder/tests/integrated/test_login.py +++ b/cinder/tests/integrated/test_login.py @@ -13,8 +13,8 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging -from cinder.openstack.common import log as logging from cinder.tests.integrated import integrated_helpers diff --git a/cinder/tests/integrated/test_volumes.py b/cinder/tests/integrated/test_volumes.py index 738470df6..abccca2a7 100644 --- a/cinder/tests/integrated/test_volumes.py +++ b/cinder/tests/integrated/test_volumes.py @@ -15,9 +15,9 @@ import time +from oslo_log import log as logging import testtools -from cinder.openstack.common import log as logging from cinder import service from cinder.tests import fake_driver from cinder.tests.integrated.api import client diff --git a/cinder/tests/integrated/test_xml.py b/cinder/tests/integrated/test_xml.py index 71bd4fc86..9307d7a16 100644 --- a/cinder/tests/integrated/test_xml.py +++ b/cinder/tests/integrated/test_xml.py @@ -14,9 +14,9 @@ # under the License. from lxml import etree +from oslo_log import log as logging from cinder.api import common -from cinder.openstack.common import log as logging from cinder.tests.integrated import integrated_helpers diff --git a/cinder/tests/scheduler/test_scheduler.py b/cinder/tests/scheduler/test_scheduler.py index bdaf35eb3..6fa261b5d 100644 --- a/cinder/tests/scheduler/test_scheduler.py +++ b/cinder/tests/scheduler/test_scheduler.py @@ -20,12 +20,12 @@ Tests For Scheduler import mock from oslo_config import cfg +from oslo_log import log as logging from cinder import context from cinder import db from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder.scheduler import driver from cinder.scheduler import filter_scheduler from cinder.scheduler import manager diff --git a/cinder/tests/test_backup.py b/cinder/tests/test_backup.py index ef5a5f3d8..48bd24e42 100644 --- a/cinder/tests/test_backup.py +++ b/cinder/tests/test_backup.py @@ -21,6 +21,7 @@ import tempfile import mock from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import importutils from oslo_utils import timeutils @@ -28,7 +29,6 @@ from cinder.backup import manager from cinder import context from cinder import db from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.tests.backup import fake_service_with_verify as fake_service diff --git a/cinder/tests/test_backup_ceph.py b/cinder/tests/test_backup_ceph.py index 2e417afa0..d2d0785b7 100644 --- a/cinder/tests/test_backup_ceph.py +++ b/cinder/tests/test_backup_ceph.py @@ -22,6 +22,7 @@ import uuid import mock from oslo_concurrency import processutils +from oslo_log import log as logging from oslo_serialization import jsonutils import six @@ -31,7 +32,6 @@ from cinder import context from cinder import db from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import test from cinder.volume.drivers import rbd as rbddriver diff --git a/cinder/tests/test_backup_swift.py b/cinder/tests/test_backup_swift.py index 52a295f3b..ea402266a 100644 --- a/cinder/tests/test_backup_swift.py +++ b/cinder/tests/test_backup_swift.py @@ -27,6 +27,7 @@ import zlib import mock from oslo_config import cfg +from oslo_log import log as logging from swiftclient import client as swift from cinder.backup.drivers import swift as swift_dr @@ -34,7 +35,6 @@ from cinder import context from cinder import db from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import test from cinder.tests.backup import fake_swift_client from cinder.tests.backup import fake_swift_client2 diff --git a/cinder/tests/test_backup_tsm.py b/cinder/tests/test_backup_tsm.py index d5e52361d..0a552abb7 100644 --- a/cinder/tests/test_backup_tsm.py +++ b/cinder/tests/test_backup_tsm.py @@ -23,12 +23,12 @@ import os import posix from oslo_concurrency import processutils as putils +from oslo_log import log as logging from cinder.backup.drivers import tsm from cinder import context from cinder import db from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder import utils diff --git a/cinder/tests/test_cmd.py b/cinder/tests/test_cmd.py index 38ccb66bd..afe44ab7a 100644 --- a/cinder/tests/test_cmd.py +++ b/cinder/tests/test_cmd.py @@ -49,7 +49,7 @@ class TestCinderApiCmd(test.TestCase): @mock.patch('cinder.service.process_launcher') @mock.patch('cinder.rpc.init') @mock.patch('cinder.utils.monkey_patch') - @mock.patch('cinder.openstack.common.log.setup') + @mock.patch('oslo_log.log.setup') def test_main(self, log_setup, monkey_patch, rpc_init, process_launcher, wsgi_service): launcher = process_launcher.return_value @@ -60,7 +60,7 @@ class TestCinderApiCmd(test.TestCase): self.assertEqual(CONF.project, 'cinder') self.assertEqual(CONF.version, version.version_string()) - log_setup.assert_called_once_with("cinder") + log_setup.assert_called_once_with(CONF, "cinder") monkey_patch.assert_called_once_with() rpc_init.assert_called_once_with(CONF) process_launcher.assert_called_once_with() @@ -84,7 +84,7 @@ class TestCinderBackupCmd(test.TestCase): @mock.patch('cinder.service.serve') @mock.patch('cinder.service.Service.create') @mock.patch('cinder.utils.monkey_patch') - @mock.patch('cinder.openstack.common.log.setup') + @mock.patch('oslo_log.log.setup') def test_main(self, log_setup, monkey_patch, service_create, service_serve, service_wait): server = service_create.return_value @@ -93,7 +93,7 @@ class TestCinderBackupCmd(test.TestCase): self.assertEqual(CONF.project, 'cinder') self.assertEqual(CONF.version, version.version_string()) - log_setup.assert_called_once_with("cinder") + log_setup.assert_called_once_with(CONF, "cinder") monkey_patch.assert_called_once_with() service_create.assert_called_once_with(binary='cinder-backup') service_serve.assert_called_once_with(server) @@ -114,8 +114,8 @@ class TestCinderAllCmd(test.TestCase): @mock.patch('cinder.service.WSGIService') @mock.patch('cinder.service.process_launcher') @mock.patch('cinder.utils.monkey_patch') - @mock.patch('cinder.openstack.common.log.getLogger') - @mock.patch('cinder.openstack.common.log.setup') + @mock.patch('oslo_log.log.getLogger') + @mock.patch('oslo_log.log.setup') def test_main(self, log_setup, get_logger, monkey_patch, process_launcher, wsgi_service, service_create): launcher = process_launcher.return_value @@ -127,7 +127,7 @@ class TestCinderAllCmd(test.TestCase): self.assertEqual(CONF.project, 'cinder') self.assertEqual(CONF.version, version.version_string()) - log_setup.assert_called_once_with("cinder") + log_setup.assert_called_once_with(CONF, "cinder") get_logger.assert_called_once_with('cinder.all') monkey_patch.assert_called_once_with() process_launcher.assert_called_once_with() @@ -147,8 +147,8 @@ class TestCinderAllCmd(test.TestCase): @mock.patch('cinder.service.WSGIService') @mock.patch('cinder.service.process_launcher') @mock.patch('cinder.utils.monkey_patch') - @mock.patch('cinder.openstack.common.log.getLogger') - @mock.patch('cinder.openstack.common.log.setup') + @mock.patch('oslo_log.log.getLogger') + @mock.patch('oslo_log.log.setup') def test_main_load_osapi_volume_exception(self, log_setup, get_logger, monkey_patch, process_launcher, wsgi_service, service_create): @@ -164,7 +164,7 @@ class TestCinderAllCmd(test.TestCase): self.assertEqual(CONF.project, 'cinder') self.assertEqual(CONF.version, version.version_string()) - log_setup.assert_called_once_with("cinder") + log_setup.assert_called_once_with(CONF, "cinder") get_logger.assert_called_once_with('cinder.all') monkey_patch.assert_called_once_with() process_launcher.assert_called_once_with() @@ -185,8 +185,8 @@ class TestCinderAllCmd(test.TestCase): @mock.patch('cinder.service.WSGIService') @mock.patch('cinder.service.process_launcher') @mock.patch('cinder.utils.monkey_patch') - @mock.patch('cinder.openstack.common.log.getLogger') - @mock.patch('cinder.openstack.common.log.setup') + @mock.patch('oslo_log.log.getLogger') + @mock.patch('oslo_log.log.setup') def test_main_load_binary_exception(self, log_setup, get_logger, monkey_patch, process_launcher, wsgi_service, service_create): @@ -206,7 +206,7 @@ class TestCinderAllCmd(test.TestCase): self.assertEqual(CONF.project, 'cinder') self.assertEqual(CONF.version, version.version_string()) - log_setup.assert_called_once_with("cinder") + log_setup.assert_called_once_with(CONF, "cinder") get_logger.assert_called_once_with('cinder.all') monkey_patch.assert_called_once_with() process_launcher.assert_called_once_with() @@ -233,7 +233,7 @@ class TestCinderSchedulerCmd(test.TestCase): @mock.patch('cinder.service.serve') @mock.patch('cinder.service.Service.create') @mock.patch('cinder.utils.monkey_patch') - @mock.patch('cinder.openstack.common.log.setup') + @mock.patch('oslo_log.log.setup') def test_main(self, log_setup, monkey_patch, service_create, service_serve, service_wait): server = service_create.return_value @@ -242,7 +242,7 @@ class TestCinderSchedulerCmd(test.TestCase): self.assertEqual(CONF.project, 'cinder') self.assertEqual(CONF.version, version.version_string()) - log_setup.assert_called_once_with("cinder") + log_setup.assert_called_once_with(CONF, "cinder") monkey_patch.assert_called_once_with() service_create.assert_called_once_with(binary='cinder-scheduler') service_serve.assert_called_once_with(server) @@ -262,7 +262,7 @@ class TestCinderVolumeCmd(test.TestCase): @mock.patch('cinder.service.get_launcher') @mock.patch('cinder.service.Service.create') @mock.patch('cinder.utils.monkey_patch') - @mock.patch('cinder.openstack.common.log.setup') + @mock.patch('oslo_log.log.setup') def test_main(self, log_setup, monkey_patch, service_create, get_launcher): CONF.set_override('enabled_backends', None) @@ -273,7 +273,7 @@ class TestCinderVolumeCmd(test.TestCase): self.assertEqual(CONF.project, 'cinder') self.assertEqual(CONF.version, version.version_string()) - log_setup.assert_called_once_with("cinder") + log_setup.assert_called_once_with(CONF, "cinder") monkey_patch.assert_called_once_with() get_launcher.assert_called_once_with() service_create.assert_called_once_with(binary='cinder-volume') @@ -283,7 +283,7 @@ class TestCinderVolumeCmd(test.TestCase): @mock.patch('cinder.service.get_launcher') @mock.patch('cinder.service.Service.create') @mock.patch('cinder.utils.monkey_patch') - @mock.patch('cinder.openstack.common.log.setup') + @mock.patch('oslo_log.log.setup') def test_main_with_backends(self, log_setup, monkey_patch, service_create, get_launcher): backends = ['backend1', 'backend2'] @@ -294,7 +294,7 @@ class TestCinderVolumeCmd(test.TestCase): self.assertEqual(CONF.project, 'cinder') self.assertEqual(CONF.version, version.version_string()) - log_setup.assert_called_once_with("cinder") + log_setup.assert_called_once_with(CONF, "cinder") monkey_patch.assert_called_once_with() get_launcher.assert_called_once_with() self.assertEqual(len(backends), service_create.call_count) @@ -650,7 +650,7 @@ class TestCinderManageCmd(test.TestCase): self.assertEqual(exit.code, 2) @mock.patch('oslo_config.cfg.ConfigOpts.__call__') - @mock.patch('cinder.openstack.common.log.setup') + @mock.patch('oslo_log.log.setup') @mock.patch('oslo_config.cfg.ConfigOpts.register_cli_opt') def test_main_sudo_failed(self, register_cli_opt, log_setup, config_opts_call): @@ -1037,8 +1037,8 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase): @mock.patch('cinder.utils.last_completed_audit_period') @mock.patch('cinder.rpc.init') @mock.patch('cinder.version.version_string') - @mock.patch('cinder.openstack.common.log.getLogger') - @mock.patch('cinder.openstack.common.log.setup') + @mock.patch('oslo_log.log.getLogger') + @mock.patch('oslo_log.log.setup') @mock.patch('cinder.context.get_admin_context') def test_main_time_error(self, get_admin_context, log_setup, get_logger, version_string, rpc_init, @@ -1053,7 +1053,7 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase): get_admin_context.assert_called_once_with() self.assertEqual(CONF.project, 'cinder') self.assertEqual(CONF.version, version.version_string()) - log_setup.assert_called_once_with("cinder") + log_setup.assert_called_once_with(CONF, "cinder") get_logger.assert_called_once_with('cinder') self.assertEqual(exit.code, -1) rpc_init.assert_called_once_with(CONF) @@ -1064,8 +1064,8 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase): @mock.patch('cinder.utils.last_completed_audit_period') @mock.patch('cinder.rpc.init') @mock.patch('cinder.version.version_string') - @mock.patch('cinder.openstack.common.log.getLogger') - @mock.patch('cinder.openstack.common.log.setup') + @mock.patch('oslo_log.log.getLogger') + @mock.patch('oslo_log.log.setup') @mock.patch('cinder.context.get_admin_context') def test_main_send_create_volume_error(self, get_admin_context, log_setup, get_logger, version_string, @@ -1109,7 +1109,7 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase): get_admin_context.assert_called_once_with() self.assertEqual(CONF.project, 'cinder') self.assertEqual(CONF.version, version.version_string()) - log_setup.assert_called_once_with("cinder") + log_setup.assert_called_once_with(CONF, "cinder") get_logger.assert_called_once_with('cinder') rpc_init.assert_called_once_with(CONF) last_completed_audit_period.assert_called_once_with() @@ -1126,8 +1126,8 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase): @mock.patch('cinder.utils.last_completed_audit_period') @mock.patch('cinder.rpc.init') @mock.patch('cinder.version.version_string') - @mock.patch('cinder.openstack.common.log.getLogger') - @mock.patch('cinder.openstack.common.log.setup') + @mock.patch('oslo_log.log.getLogger') + @mock.patch('oslo_log.log.setup') @mock.patch('cinder.context.get_admin_context') def test_main_send_delete_volume_error(self, get_admin_context, log_setup, get_logger, version_string, @@ -1175,7 +1175,7 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase): get_admin_context.assert_called_once_with() self.assertEqual(CONF.project, 'cinder') self.assertEqual(CONF.version, version.version_string()) - log_setup.assert_called_once_with("cinder") + log_setup.assert_called_once_with(CONF, "cinder") get_logger.assert_called_once_with('cinder') rpc_init.assert_called_once_with(CONF) last_completed_audit_period.assert_called_once_with() @@ -1202,8 +1202,8 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase): @mock.patch('cinder.utils.last_completed_audit_period') @mock.patch('cinder.rpc.init') @mock.patch('cinder.version.version_string') - @mock.patch('cinder.openstack.common.log.getLogger') - @mock.patch('cinder.openstack.common.log.setup') + @mock.patch('oslo_log.log.getLogger') + @mock.patch('oslo_log.log.setup') @mock.patch('cinder.context.get_admin_context') def test_main_send_snapshot_error(self, get_admin_context, log_setup, get_logger, @@ -1253,7 +1253,7 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase): get_admin_context.assert_called_once_with() self.assertEqual(CONF.project, 'cinder') self.assertEqual(CONF.version, version.version_string()) - log_setup.assert_called_once_with("cinder") + log_setup.assert_called_once_with(CONF, "cinder") get_logger.assert_called_once_with('cinder') rpc_init.assert_called_once_with(CONF) last_completed_audit_period.assert_called_once_with() @@ -1275,8 +1275,8 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase): @mock.patch('cinder.utils.last_completed_audit_period') @mock.patch('cinder.rpc.init') @mock.patch('cinder.version.version_string') - @mock.patch('cinder.openstack.common.log.getLogger') - @mock.patch('cinder.openstack.common.log.setup') + @mock.patch('oslo_log.log.getLogger') + @mock.patch('oslo_log.log.setup') @mock.patch('cinder.context.get_admin_context') def test_main(self, get_admin_context, log_setup, get_logger, version_string, rpc_init, last_completed_audit_period, @@ -1330,7 +1330,7 @@ class TestCinderVolumeUsageAuditCmd(test.TestCase): get_admin_context.assert_called_once_with() self.assertEqual(CONF.project, 'cinder') self.assertEqual(CONF.version, version.version_string()) - log_setup.assert_called_once_with("cinder") + log_setup.assert_called_once_with(CONF, "cinder") get_logger.assert_called_once_with('cinder') rpc_init.assert_called_once_with(CONF) last_completed_audit_period.assert_called_once_with() diff --git a/cinder/tests/test_coraid.py b/cinder/tests/test_coraid.py index 8a46bfe86..736bd6e18 100644 --- a/cinder/tests/test_coraid.py +++ b/cinder/tests/test_coraid.py @@ -19,13 +19,13 @@ import math import mock import mox from oslo_config import cfg +from oslo_log import log as logging from oslo_serialization import jsonutils from oslo_utils import units from cinder.brick.initiator import connector from cinder import exception from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder import test from cinder import utils from cinder.volume import configuration as conf diff --git a/cinder/tests/test_dellfc.py b/cinder/tests/test_dellfc.py index 362e7e018..cf16e5b13 100644 --- a/cinder/tests/test_dellfc.py +++ b/cinder/tests/test_dellfc.py @@ -13,10 +13,10 @@ # under the License. import mock +from oslo_log import log as logging from cinder import context from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume.drivers.dell import dell_storagecenter_api from cinder.volume.drivers.dell import dell_storagecenter_fc diff --git a/cinder/tests/test_dellsc.py b/cinder/tests/test_dellsc.py index ce3573ed3..9115d53f2 100644 --- a/cinder/tests/test_dellsc.py +++ b/cinder/tests/test_dellsc.py @@ -12,9 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging + from cinder import context from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume.drivers.dell import dell_storagecenter_api from cinder.volume.drivers.dell import dell_storagecenter_iscsi diff --git a/cinder/tests/test_dellscapi.py b/cinder/tests/test_dellscapi.py index c167f0573..74a0ce7b3 100644 --- a/cinder/tests/test_dellscapi.py +++ b/cinder/tests/test_dellscapi.py @@ -12,9 +12,10 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging + from cinder import context from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume.drivers.dell import dell_storagecenter_api diff --git a/cinder/tests/test_drbdmanagedrv.py b/cinder/tests/test_drbdmanagedrv.py index b907b90cf..f5caaf619 100644 --- a/cinder/tests/test_drbdmanagedrv.py +++ b/cinder/tests/test_drbdmanagedrv.py @@ -16,11 +16,11 @@ import collections import mock +from oslo_log import log as logging from oslo_utils import importutils from oslo_utils import timeutils from cinder import context -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf diff --git a/cinder/tests/test_emc_vmax.py b/cinder/tests/test_emc_vmax.py index 1a9506aed..6531a00f8 100644 --- a/cinder/tests/test_emc_vmax.py +++ b/cinder/tests/test_emc_vmax.py @@ -20,10 +20,10 @@ import time from xml.dom import minidom import mock +from oslo_log import log as logging import six from cinder import exception -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder import test from cinder.volume.drivers.emc import emc_vmax_common diff --git a/cinder/tests/test_emc_xtremio.py b/cinder/tests/test_emc_xtremio.py index 3ffc30662..a7e90db84 100644 --- a/cinder/tests/test_emc_xtremio.py +++ b/cinder/tests/test_emc_xtremio.py @@ -15,10 +15,10 @@ import mock +from oslo_log import log as logging import six from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume.drivers.emc import xtremio diff --git a/cinder/tests/test_eqlx.py b/cinder/tests/test_eqlx.py index b5fb350cf..32e3d4417 100644 --- a/cinder/tests/test_eqlx.py +++ b/cinder/tests/test_eqlx.py @@ -19,11 +19,11 @@ from eventlet import greenthread import mock import mox from oslo_concurrency import processutils +from oslo_log import log as logging import paramiko from cinder import context from cinder import exception -from cinder.openstack.common import log as logging from cinder import ssh_utils from cinder import test from cinder import utils diff --git a/cinder/tests/test_fujitsu.py b/cinder/tests/test_fujitsu.py index bd7cc73d9..8b05421ab 100644 --- a/cinder/tests/test_fujitsu.py +++ b/cinder/tests/test_fujitsu.py @@ -18,10 +18,10 @@ import os import tempfile import mock +from oslo_log import log as logging from cinder import exception from cinder.i18n import _LW -from cinder.openstack.common import log as logging from cinder import test import cinder.volume.drivers.fujitsu.eternus_dx_common as eternus_dx_common import cinder.volume.drivers.fujitsu.eternus_dx_fc as eternus_dx_fc diff --git a/cinder/tests/test_fusionio_ioControl.py b/cinder/tests/test_fusionio_ioControl.py index 0964e26e4..e761d71f6 100644 --- a/cinder/tests/test_fusionio_ioControl.py +++ b/cinder/tests/test_fusionio_ioControl.py @@ -17,6 +17,7 @@ import copy import json import mock +from oslo_log import log as logging from oslo_utils import timeutils from oslo_utils import units import requests @@ -24,7 +25,6 @@ import requests from cinder import context from cinder.db.sqlalchemy import models from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf from cinder.volume.drivers.fusionio import ioControl diff --git a/cinder/tests/test_gpfs.py b/cinder/tests/test_gpfs.py index f2c8aebf3..33315c353 100644 --- a/cinder/tests/test_gpfs.py +++ b/cinder/tests/test_gpfs.py @@ -19,11 +19,11 @@ import tempfile import mock from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units from cinder import context from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder import utils from cinder.volume import configuration as conf diff --git a/cinder/tests/test_hds_hnas_backend.py b/cinder/tests/test_hds_hnas_backend.py index f4c1142fb..2688c69ee 100644 --- a/cinder/tests/test_hds_hnas_backend.py +++ b/cinder/tests/test_hds_hnas_backend.py @@ -17,8 +17,8 @@ import mock from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging -from cinder.openstack.common import log as logging from cinder import test from cinder import utils from cinder.volume.drivers.hds import hnas_backend diff --git a/cinder/tests/test_hds_iscsi.py b/cinder/tests/test_hds_iscsi.py index 231df11c1..24abcb4d3 100644 --- a/cinder/tests/test_hds_iscsi.py +++ b/cinder/tests/test_hds_iscsi.py @@ -23,9 +23,9 @@ import StringIO import tempfile import mock +from oslo_log import log as logging from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf from cinder.volume.drivers.hds import iscsi diff --git a/cinder/tests/test_hds_nfs.py b/cinder/tests/test_hds_nfs.py index d0d779252..8785591c4 100644 --- a/cinder/tests/test_hds_nfs.py +++ b/cinder/tests/test_hds_nfs.py @@ -19,9 +19,9 @@ import StringIO import tempfile import mock +from oslo_log import log as logging from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf from cinder.volume.drivers.hds import nfs diff --git a/cinder/tests/test_hp3par.py b/cinder/tests/test_hp3par.py index 258b67b30..623195143 100644 --- a/cinder/tests/test_hp3par.py +++ b/cinder/tests/test_hp3par.py @@ -20,11 +20,11 @@ import mock import ast from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units from cinder import context from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.tests import fake_hp_3par_client as hp3parclient from cinder.volume.drivers.san.hp import hp_3par_common as hpcommon diff --git a/cinder/tests/test_hplefthand.py b/cinder/tests/test_hplefthand.py index 9e3e2608c..3a7b8a996 100644 --- a/cinder/tests/test_hplefthand.py +++ b/cinder/tests/test_hplefthand.py @@ -14,12 +14,13 @@ # under the License. # """Unit tests for OpenStack Cinder volume drivers.""" + import mock +from oslo_log import log as logging from oslo_utils import units from cinder import context from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.tests import fake_hp_lefthand_client as hplefthandclient from cinder.volume.drivers.san.hp import hp_lefthand_iscsi diff --git a/cinder/tests/test_huawei_18000.py b/cinder/tests/test_huawei_18000.py index b87497614..370a4c826 100644 --- a/cinder/tests/test_huawei_18000.py +++ b/cinder/tests/test_huawei_18000.py @@ -21,9 +21,9 @@ import time from xml.dom import minidom import mock +from oslo_log import log as logging from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf from cinder.volume.drivers.huawei import huawei_18000 diff --git a/cinder/tests/test_ibm_flashsystem.py b/cinder/tests/test_ibm_flashsystem.py index 7c3263ad4..eaae98df1 100644 --- a/cinder/tests/test_ibm_flashsystem.py +++ b/cinder/tests/test_ibm_flashsystem.py @@ -21,6 +21,7 @@ Tests for the IBM FlashSystem volume driver. import mock from oslo_concurrency import processutils +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units import six @@ -30,7 +31,6 @@ import re from cinder import context from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder import utils from cinder.volume import configuration as conf diff --git a/cinder/tests/test_ibmnas.py b/cinder/tests/test_ibmnas.py index 01e8efeb0..e90ef1d59 100644 --- a/cinder/tests/test_ibmnas.py +++ b/cinder/tests/test_ibmnas.py @@ -23,11 +23,11 @@ NAS based IBM GPFS Storage Systems). import mock from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units from cinder import context from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf from cinder.volume.drivers.ibm import ibmnas diff --git a/cinder/tests/test_netapp.py b/cinder/tests/test_netapp.py index d774985bf..ef78eb8ff 100644 --- a/cinder/tests/test_netapp.py +++ b/cinder/tests/test_netapp.py @@ -22,10 +22,10 @@ import httplib from lxml import etree import mock +from oslo_log import log as logging import six from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf from cinder.volume.drivers.netapp import common diff --git a/cinder/tests/test_netapp_eseries_iscsi.py b/cinder/tests/test_netapp_eseries_iscsi.py index a52c5f6aa..e972adc91 100644 --- a/cinder/tests/test_netapp_eseries_iscsi.py +++ b/cinder/tests/test_netapp_eseries_iscsi.py @@ -23,11 +23,11 @@ import json import re import mock +from oslo_log import log as logging import requests import six.moves.urllib.parse as urlparse from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf from cinder.volume.drivers.netapp import common diff --git a/cinder/tests/test_netapp_nfs.py b/cinder/tests/test_netapp_nfs.py index 8f082d7fd..f503169ba 100644 --- a/cinder/tests/test_netapp_nfs.py +++ b/cinder/tests/test_netapp_nfs.py @@ -22,12 +22,12 @@ import unittest from lxml import etree import mock import mox as mox_lib +from oslo_log import log as logging import six from cinder import exception from cinder.i18n import _LW from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder import test from cinder import utils as cinder_utils from cinder.volume import configuration as conf diff --git a/cinder/tests/test_nimble.py b/cinder/tests/test_nimble.py index 4b3989caf..ba3592337 100644 --- a/cinder/tests/test_nimble.py +++ b/cinder/tests/test_nimble.py @@ -15,9 +15,9 @@ import mock from oslo_config import cfg +from oslo_log import log as logging from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume.drivers import nimble diff --git a/cinder/tests/test_qos_specs.py b/cinder/tests/test_qos_specs.py index 01ec065b6..425cb3272 100644 --- a/cinder/tests/test_qos_specs.py +++ b/cinder/tests/test_qos_specs.py @@ -20,11 +20,11 @@ Unit Tests for qos specs internal API import time from oslo_db import exception as db_exc +from oslo_log import log as logging from cinder import context from cinder import db from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import qos_specs from cinder.volume import volume_types diff --git a/cinder/tests/test_rbd.py b/cinder/tests/test_rbd.py index d59ea08eb..b30735293 100644 --- a/cinder/tests/test_rbd.py +++ b/cinder/tests/test_rbd.py @@ -21,6 +21,7 @@ import os import tempfile import mock +from oslo_log import log as logging from oslo_utils import timeutils from oslo_utils import units @@ -28,7 +29,6 @@ from cinder import db from cinder import exception from cinder.i18n import _ from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder import test from cinder.tests.image import fake as fake_image from cinder.tests import test_volume diff --git a/cinder/tests/test_solidfire.py b/cinder/tests/test_solidfire.py index 5732a3f33..1cb90aa89 100644 --- a/cinder/tests/test_solidfire.py +++ b/cinder/tests/test_solidfire.py @@ -18,12 +18,12 @@ import datetime import mock import mox +from oslo_log import log as logging from oslo_utils import timeutils from oslo_utils import units from cinder import context from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf from cinder.volume.drivers import solidfire diff --git a/cinder/tests/test_srb.py b/cinder/tests/test_srb.py index 062121349..36adfd83a 100644 --- a/cinder/tests/test_srb.py +++ b/cinder/tests/test_srb.py @@ -18,11 +18,11 @@ Unit tests for the Scality Rest Block Volume Driver. import mock from oslo_concurrency import processutils +from oslo_log import log as logging from oslo_utils import units from cinder import context from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.tests.brick import test_brick_lvm from cinder.volume import configuration as conf diff --git a/cinder/tests/test_storwize_svc.py b/cinder/tests/test_storwize_svc.py index 6150705ef..c4f85e7f5 100644 --- a/cinder/tests/test_storwize_svc.py +++ b/cinder/tests/test_storwize_svc.py @@ -24,6 +24,7 @@ import time import mock from oslo_concurrency import processutils +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import importutils from oslo_utils import units @@ -31,7 +32,6 @@ from oslo_utils import units from cinder import context from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import test from cinder.tests import utils as testutils from cinder import utils diff --git a/cinder/tests/test_symantec_cnfs.py b/cinder/tests/test_symantec_cnfs.py index 8120d5fe2..3e9d77e74 100644 --- a/cinder/tests/test_symantec_cnfs.py +++ b/cinder/tests/test_symantec_cnfs.py @@ -18,10 +18,10 @@ import os import mock from oslo_config import cfg +from oslo_log import log as logging from cinder import context from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf from cinder.volume.drivers import symantec_cnfs as cnfs diff --git a/cinder/tests/test_volume.py b/cinder/tests/test_volume.py index 9ca4c64fc..cf66d7fbf 100644 --- a/cinder/tests/test_volume.py +++ b/cinder/tests/test_volume.py @@ -31,6 +31,7 @@ import mock import mox from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_serialization import jsonutils from oslo_utils import importutils from oslo_utils import timeutils @@ -47,7 +48,6 @@ from cinder.image import image_utils from cinder import keymgr from cinder import objects from cinder.openstack.common import fileutils -from cinder.openstack.common import log as logging import cinder.policy from cinder import quota from cinder import test diff --git a/cinder/tests/test_volume_configuration.py b/cinder/tests/test_volume_configuration.py index 55c927abf..377707077 100644 --- a/cinder/tests/test_volume_configuration.py +++ b/cinder/tests/test_volume_configuration.py @@ -17,8 +17,8 @@ from oslo_config import cfg +from oslo_log import log as logging -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration diff --git a/cinder/tests/test_volume_transfer.py b/cinder/tests/test_volume_transfer.py index 0922711de..2b6162f1a 100644 --- a/cinder/tests/test_volume_transfer.py +++ b/cinder/tests/test_volume_transfer.py @@ -15,10 +15,11 @@ import datetime +from oslo_log import log as logging + from cinder import context from cinder import db from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.tests import utils from cinder.transfer import api as transfer_api diff --git a/cinder/tests/test_volume_types.py b/cinder/tests/test_volume_types.py index 4fa6b1ee7..a3ed37aeb 100644 --- a/cinder/tests/test_volume_types.py +++ b/cinder/tests/test_volume_types.py @@ -20,6 +20,7 @@ import datetime import time from oslo_config import cfg +from oslo_log import log as logging from cinder import context from cinder import db @@ -27,7 +28,6 @@ from cinder.db.sqlalchemy import api as db_api from cinder.db.sqlalchemy import models from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import test from cinder.tests import conf_fixture from cinder.volume import qos_specs diff --git a/cinder/tests/test_volume_utils.py b/cinder/tests/test_volume_utils.py index 357342a34..cd49bf6b9 100644 --- a/cinder/tests/test_volume_utils.py +++ b/cinder/tests/test_volume_utils.py @@ -18,9 +18,9 @@ import mock from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder import utils from cinder.volume import throttling diff --git a/cinder/tests/test_xio.py b/cinder/tests/test_xio.py index ed6af574e..193fa6b3c 100644 --- a/cinder/tests/test_xio.py +++ b/cinder/tests/test_xio.py @@ -14,10 +14,10 @@ # under the License. import mock +from oslo_log import log as logging from cinder import context from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume.drivers import xio from cinder.volume import qos_specs diff --git a/cinder/tests/test_zadara.py b/cinder/tests/test_zadara.py index b7094ed04..a37a4b5d0 100644 --- a/cinder/tests/test_zadara.py +++ b/cinder/tests/test_zadara.py @@ -20,8 +20,9 @@ Tests for Zadara VPSA volume driver import copy import httplib +from oslo_log import log as logging + from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf from cinder.volume.drivers import zadara diff --git a/cinder/tests/test_zfssa.py b/cinder/tests/test_zfssa.py index 96dd3807b..059fa7302 100644 --- a/cinder/tests/test_zfssa.py +++ b/cinder/tests/test_zfssa.py @@ -18,9 +18,9 @@ Unit tests for Oracle's ZFSSA Cinder volume driver import json import mock +from oslo_log import log as logging from oslo_utils import units -from cinder.openstack.common import log as logging from cinder import test from cinder.tests import fake_utils from cinder.volume import configuration as conf diff --git a/cinder/tests/volume/drivers/datera.py b/cinder/tests/volume/drivers/datera.py index 6f403bc84..8071817ba 100644 --- a/cinder/tests/volume/drivers/datera.py +++ b/cinder/tests/volume/drivers/datera.py @@ -14,10 +14,10 @@ # under the License. import mock +from oslo_log import log as logging from cinder import context from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf from cinder.volume.drivers import datera diff --git a/cinder/tests/zonemanager/test_brcd_fc_san_lookup_service.py b/cinder/tests/zonemanager/test_brcd_fc_san_lookup_service.py index 053191508..3b20bd11a 100644 --- a/cinder/tests/zonemanager/test_brcd_fc_san_lookup_service.py +++ b/cinder/tests/zonemanager/test_brcd_fc_san_lookup_service.py @@ -21,10 +21,10 @@ import mock from oslo_config import cfg +from oslo_log import log as logging import paramiko from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf import cinder.zonemanager.drivers.brocade.brcd_fc_san_lookup_service \ diff --git a/cinder/tests/zonemanager/test_brcd_fc_zone_client_cli.py b/cinder/tests/zonemanager/test_brcd_fc_zone_client_cli.py index ca6d96ded..46e67eb0e 100644 --- a/cinder/tests/zonemanager/test_brcd_fc_zone_client_cli.py +++ b/cinder/tests/zonemanager/test_brcd_fc_zone_client_cli.py @@ -21,9 +21,9 @@ import mock from oslo_concurrency import processutils +from oslo_log import log as logging from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.zonemanager.drivers.brocade \ import brcd_fc_zone_client_cli as client_cli diff --git a/cinder/tests/zonemanager/test_brcd_fc_zone_driver.py b/cinder/tests/zonemanager/test_brcd_fc_zone_driver.py index e34ddf844..24c5f49c7 100644 --- a/cinder/tests/zonemanager/test_brcd_fc_zone_driver.py +++ b/cinder/tests/zonemanager/test_brcd_fc_zone_driver.py @@ -21,12 +21,12 @@ import mock from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import importutils import paramiko from cinder import exception from cinder.i18n import _LI -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf from cinder.zonemanager.drivers.brocade import brcd_fc_zone_driver as driver diff --git a/cinder/tests/zonemanager/test_brcd_lookup_service.py b/cinder/tests/zonemanager/test_brcd_lookup_service.py index ed6cc51b0..5010bb0b4 100644 --- a/cinder/tests/zonemanager/test_brcd_lookup_service.py +++ b/cinder/tests/zonemanager/test_brcd_lookup_service.py @@ -19,8 +19,9 @@ """Unit tests for fc san lookup service.""" +from oslo_log import log as logging + from cinder import exception -from cinder.openstack.common import log as logging from cinder import test from cinder.volume import configuration as conf from cinder.zonemanager import fc_san_lookup_service as san_service diff --git a/cinder/transfer/api.py b/cinder/transfer/api.py index 164a97e7e..08211757e 100644 --- a/cinder/transfer/api.py +++ b/cinder/transfer/api.py @@ -23,12 +23,12 @@ import hmac import os from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from cinder.db import base from cinder import exception from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder import quota from cinder.volume import api as volume_api diff --git a/cinder/utils.py b/cinder/utils.py index 378f238e2..d01ca8f78 100644 --- a/cinder/utils.py +++ b/cinder/utils.py @@ -38,6 +38,7 @@ from xml.sax import saxutils from oslo_concurrency import lockutils from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import importutils from oslo_utils import timeutils import retrying @@ -46,7 +47,6 @@ import six from cinder.brick.initiator import connector from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging CONF = cfg.CONF diff --git a/cinder/volume/api.py b/cinder/volume/api.py index b322a09ac..a755717e6 100644 --- a/cinder/volume/api.py +++ b/cinder/volume/api.py @@ -24,6 +24,7 @@ import datetime import functools from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import timeutils from oslo_utils import uuidutils @@ -38,7 +39,6 @@ from cinder.image import glance from cinder import keymgr from cinder import objects from cinder.objects import base as objects_base -from cinder.openstack.common import log as logging import cinder.policy from cinder import quota from cinder import quota_utils diff --git a/cinder/volume/configuration.py b/cinder/volume/configuration.py index 6b9836837..ceb2a5ee3 100644 --- a/cinder/volume/configuration.py +++ b/cinder/volume/configuration.py @@ -41,8 +41,7 @@ and registered in the group in which they are used. from oslo_config import cfg - -from cinder.openstack.common import log as logging +from oslo_log import log as logging CONF = cfg.CONF diff --git a/cinder/volume/driver.py b/cinder/volume/driver.py index 5b96bc81f..4e6ad3f29 100644 --- a/cinder/volume/driver.py +++ b/cinder/volume/driver.py @@ -22,6 +22,7 @@ import time from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils import six @@ -29,7 +30,6 @@ from cinder import exception from cinder.i18n import _, _LE, _LW from cinder.image import image_utils from cinder.openstack.common import fileutils -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume import rpcapi as volume_rpcapi from cinder.volume import throttling diff --git a/cinder/volume/drivers/block_device.py b/cinder/volume/drivers/block_device.py index 4b49c0f40..9e76c1fee 100644 --- a/cinder/volume/drivers/block_device.py +++ b/cinder/volume/drivers/block_device.py @@ -16,6 +16,7 @@ import os from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import importutils from cinder import context @@ -23,7 +24,6 @@ from cinder.db.sqlalchemy import api from cinder import exception from cinder.i18n import _, _LI from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume import utils as volutils diff --git a/cinder/volume/drivers/cloudbyte/cloudbyte.py b/cinder/volume/drivers/cloudbyte/cloudbyte.py index b54f0593c..dc76dbc15 100644 --- a/cinder/volume/drivers/cloudbyte/cloudbyte.py +++ b/cinder/volume/drivers/cloudbyte/cloudbyte.py @@ -18,12 +18,12 @@ import json import time import urllib +from oslo_log import log as logging from oslo_utils import units import six from cinder import exception from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder.volume.drivers.cloudbyte import options from cinder.volume.drivers.san import san diff --git a/cinder/volume/drivers/coraid.py b/cinder/volume/drivers/coraid.py index 1e16d699d..c625a396e 100644 --- a/cinder/volume/drivers/coraid.py +++ b/cinder/volume/drivers/coraid.py @@ -28,13 +28,13 @@ import urllib2 from oslo_concurrency import lockutils from oslo_config import cfg +from oslo_log import log as logging from oslo_serialization import jsonutils from oslo_utils import units import six.moves.urllib.parse as urlparse from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume import volume_types diff --git a/cinder/volume/drivers/datera.py b/cinder/volume/drivers/datera.py index f556afcc5..8481363d8 100644 --- a/cinder/volume/drivers/datera.py +++ b/cinder/volume/drivers/datera.py @@ -16,13 +16,13 @@ import json from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units import requests from cinder import exception from cinder.i18n import _, _LE, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import versionutils from cinder.volume.drivers.san import san diff --git a/cinder/volume/drivers/dell/dell_storagecenter_api.py b/cinder/volume/drivers/dell/dell_storagecenter_api.py index 228b3c0a8..1f5869a44 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_api.py +++ b/cinder/volume/drivers/dell/dell_storagecenter_api.py @@ -16,12 +16,12 @@ import json import os.path +from oslo_log import log as logging import requests import six from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder import utils diff --git a/cinder/volume/drivers/dell/dell_storagecenter_common.py b/cinder/volume/drivers/dell/dell_storagecenter_common.py index 536d4608a..f72333a6d 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_common.py +++ b/cinder/volume/drivers/dell/dell_storagecenter_common.py @@ -13,11 +13,11 @@ # under the License. from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from cinder import exception from cinder.i18n import _, _LE, _LW -from cinder.openstack.common import log as logging from cinder.volume.drivers.dell import dell_storagecenter_api from cinder.volume.drivers.san import san diff --git a/cinder/volume/drivers/dell/dell_storagecenter_fc.py b/cinder/volume/drivers/dell/dell_storagecenter_fc.py index 25da6cb79..513e4779f 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_fc.py +++ b/cinder/volume/drivers/dell/dell_storagecenter_fc.py @@ -14,11 +14,11 @@ '''Volume driver for Dell Storage Center.''' +from oslo_log import log as logging from oslo_utils import excutils from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume.drivers.dell import dell_storagecenter_common from cinder.zonemanager import utils as fczm_utils diff --git a/cinder/volume/drivers/dell/dell_storagecenter_iscsi.py b/cinder/volume/drivers/dell/dell_storagecenter_iscsi.py index 0f5329516..40eb7614c 100644 --- a/cinder/volume/drivers/dell/dell_storagecenter_iscsi.py +++ b/cinder/volume/drivers/dell/dell_storagecenter_iscsi.py @@ -14,11 +14,11 @@ '''Volume driver for Dell Storage Center.''' +from oslo_log import log as logging from oslo_utils import excutils from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder.volume.drivers.dell import dell_storagecenter_common from cinder.volume.drivers import san diff --git a/cinder/volume/drivers/drbdmanagedrv.py b/cinder/volume/drivers/drbdmanagedrv.py index b1b67396d..92d9573d2 100644 --- a/cinder/volume/drivers/drbdmanagedrv.py +++ b/cinder/volume/drivers/drbdmanagedrv.py @@ -26,6 +26,7 @@ for more details. import uuid from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import importutils from oslo_utils import units import six @@ -33,7 +34,6 @@ import six from cinder import exception from cinder.i18n import _, _LW -from cinder.openstack.common import log as logging from cinder.volume import driver try: diff --git a/cinder/volume/drivers/emc/emc_cli_fc.py b/cinder/volume/drivers/emc/emc_cli_fc.py index a05b3031e..20b983cc3 100644 --- a/cinder/volume/drivers/emc/emc_cli_fc.py +++ b/cinder/volume/drivers/emc/emc_cli_fc.py @@ -17,7 +17,8 @@ Fibre Channel Driver for EMC VNX array based on CLI. """ -from cinder.openstack.common import log as logging +from oslo_log import log as logging + from cinder.volume import driver from cinder.volume.drivers.emc import emc_vnx_cli from cinder.zonemanager import utils as zm_utils diff --git a/cinder/volume/drivers/emc/emc_cli_iscsi.py b/cinder/volume/drivers/emc/emc_cli_iscsi.py index b5f943405..7055bda36 100644 --- a/cinder/volume/drivers/emc/emc_cli_iscsi.py +++ b/cinder/volume/drivers/emc/emc_cli_iscsi.py @@ -17,7 +17,8 @@ iSCSI Drivers for EMC VNX array based on CLI. """ -from cinder.openstack.common import log as logging +from oslo_log import log as logging + from cinder.volume import driver from cinder.volume.drivers.emc import emc_vnx_cli diff --git a/cinder/volume/drivers/emc/emc_vmax_common.py b/cinder/volume/drivers/emc/emc_vmax_common.py index 73d3bcd89..edff493f6 100644 --- a/cinder/volume/drivers/emc/emc_vmax_common.py +++ b/cinder/volume/drivers/emc/emc_vmax_common.py @@ -17,11 +17,11 @@ import inspect import os.path from oslo_config import cfg +from oslo_log import log as logging import six from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.volume.drivers.emc import emc_vmax_fast from cinder.volume.drivers.emc import emc_vmax_https from cinder.volume.drivers.emc import emc_vmax_masking diff --git a/cinder/volume/drivers/emc/emc_vmax_fast.py b/cinder/volume/drivers/emc/emc_vmax_fast.py index 155f3bc3d..378d0ebf6 100644 --- a/cinder/volume/drivers/emc/emc_vmax_fast.py +++ b/cinder/volume/drivers/emc/emc_vmax_fast.py @@ -12,9 +12,11 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + +from oslo_log import log as logging + from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.volume.drivers.emc import emc_vmax_provision from cinder.volume.drivers.emc import emc_vmax_utils diff --git a/cinder/volume/drivers/emc/emc_vmax_fc.py b/cinder/volume/drivers/emc/emc_vmax_fc.py index 87db5db1e..9a50d49e1 100644 --- a/cinder/volume/drivers/emc/emc_vmax_fc.py +++ b/cinder/volume/drivers/emc/emc_vmax_fc.py @@ -12,11 +12,12 @@ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. + +from oslo_log import log as logging import six from cinder import context from cinder.i18n import _LW -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume.drivers.emc import emc_vmax_common from cinder.zonemanager import utils as fczm_utils diff --git a/cinder/volume/drivers/emc/emc_vmax_https.py b/cinder/volume/drivers/emc/emc_vmax_https.py index 7098c3d1a..f3f5e961f 100644 --- a/cinder/volume/drivers/emc/emc_vmax_https.py +++ b/cinder/volume/drivers/emc/emc_vmax_https.py @@ -24,10 +24,10 @@ import urllib from eventlet import patcher import OpenSSL +from oslo_log import log as logging import six from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging # Handle case where we are running in a monkey patched environment if patcher.is_monkey_patched('socket'): diff --git a/cinder/volume/drivers/emc/emc_vmax_iscsi.py b/cinder/volume/drivers/emc/emc_vmax_iscsi.py index a1fca5745..421c5a0ed 100644 --- a/cinder/volume/drivers/emc/emc_vmax_iscsi.py +++ b/cinder/volume/drivers/emc/emc_vmax_iscsi.py @@ -18,12 +18,12 @@ ISCSI Drivers for EMC VMAX arrays based on SMI-S. """ import os +from oslo_log import log as logging import six from cinder import context from cinder import exception from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume.drivers.emc import emc_vmax_common diff --git a/cinder/volume/drivers/emc/emc_vmax_masking.py b/cinder/volume/drivers/emc/emc_vmax_masking.py index 1bef90084..d1cd7e997 100644 --- a/cinder/volume/drivers/emc/emc_vmax_masking.py +++ b/cinder/volume/drivers/emc/emc_vmax_masking.py @@ -13,11 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging import six from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.volume.drivers.emc import emc_vmax_fast from cinder.volume.drivers.emc import emc_vmax_provision from cinder.volume.drivers.emc import emc_vmax_provision_v3 diff --git a/cinder/volume/drivers/emc/emc_vmax_provision.py b/cinder/volume/drivers/emc/emc_vmax_provision.py index 1594942d9..7a9d072a0 100644 --- a/cinder/volume/drivers/emc/emc_vmax_provision.py +++ b/cinder/volume/drivers/emc/emc_vmax_provision.py @@ -14,11 +14,11 @@ # under the License. import time +from oslo_log import log as logging import six from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder.volume.drivers.emc import emc_vmax_utils diff --git a/cinder/volume/drivers/emc/emc_vmax_provision_v3.py b/cinder/volume/drivers/emc/emc_vmax_provision_v3.py index 80ca10e6a..f2aa38ad1 100644 --- a/cinder/volume/drivers/emc/emc_vmax_provision_v3.py +++ b/cinder/volume/drivers/emc/emc_vmax_provision_v3.py @@ -15,9 +15,10 @@ import time +from oslo_log import log as logging + from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder.volume.drivers.emc import emc_vmax_utils LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/emc/emc_vmax_utils.py b/cinder/volume/drivers/emc/emc_vmax_utils.py index 613853cfd..67b242c88 100644 --- a/cinder/volume/drivers/emc/emc_vmax_utils.py +++ b/cinder/volume/drivers/emc/emc_vmax_utils.py @@ -18,12 +18,12 @@ import random import re from xml.dom import minidom +from oslo_log import log as logging import six from cinder import context from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder.volume import volume_types diff --git a/cinder/volume/drivers/emc/emc_vnx_cli.py b/cinder/volume/drivers/emc/emc_vnx_cli.py index 0710cc2e6..d423a7669 100644 --- a/cinder/volume/drivers/emc/emc_vnx_cli.py +++ b/cinder/volume/drivers/emc/emc_vnx_cli.py @@ -26,6 +26,7 @@ import eventlet from oslo_concurrency import lockutils from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_serialization import jsonutils as json from oslo_utils import excutils from oslo_utils import timeutils @@ -37,7 +38,6 @@ from taskflow.types import failure from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder import utils from cinder.volume import configuration as config @@ -47,8 +47,11 @@ from cinder.volume import utils as vol_utils from cinder.volume import volume_types CONF = cfg.CONF + +logging.register_options(CONF) LOG = logging.getLogger(__name__) + INTERVAL_5_SEC = 5 INTERVAL_20_SEC = 20 INTERVAL_30_SEC = 30 diff --git a/cinder/volume/drivers/emc/xtremio.py b/cinder/volume/drivers/emc/xtremio.py index cedb856f4..38f4462ef 100644 --- a/cinder/volume/drivers/emc/xtremio.py +++ b/cinder/volume/drivers/emc/xtremio.py @@ -33,12 +33,12 @@ import urllib import urllib2 from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units import six from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume.drivers.san import san from cinder.zonemanager import utils as fczm_utils diff --git a/cinder/volume/drivers/eqlx.py b/cinder/volume/drivers/eqlx.py index c6b569130..f04be1659 100644 --- a/cinder/volume/drivers/eqlx.py +++ b/cinder/volume/drivers/eqlx.py @@ -23,11 +23,11 @@ from eventlet import greenthread import greenlet from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from cinder import exception from cinder.i18n import _, _LE, _LW, _LI -from cinder.openstack.common import log as logging from cinder import ssh_utils from cinder import utils from cinder.volume.drivers import san diff --git a/cinder/volume/drivers/fujitsu/eternus_dx_common.py b/cinder/volume/drivers/fujitsu/eternus_dx_common.py index a827fc0c4..44c60106c 100644 --- a/cinder/volume/drivers/fujitsu/eternus_dx_common.py +++ b/cinder/volume/drivers/fujitsu/eternus_dx_common.py @@ -26,12 +26,12 @@ import time from xml.dom import minidom from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units import six from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder.volume import volume_types diff --git a/cinder/volume/drivers/fujitsu/eternus_dx_fc.py b/cinder/volume/drivers/fujitsu/eternus_dx_fc.py index 695538a0a..d5b4516b4 100644 --- a/cinder/volume/drivers/fujitsu/eternus_dx_fc.py +++ b/cinder/volume/drivers/fujitsu/eternus_dx_fc.py @@ -18,10 +18,10 @@ FC Drivers for ETERNUS DX arrays based on SMI-S. """ from oslo_concurrency import lockutils +from oslo_log import log as logging import six from cinder import context -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume.drivers.fujitsu import eternus_dx_common from cinder.zonemanager import utils as fczm_utils diff --git a/cinder/volume/drivers/fujitsu/eternus_dx_iscsi.py b/cinder/volume/drivers/fujitsu/eternus_dx_iscsi.py index 36bb0697f..34ffd0151 100644 --- a/cinder/volume/drivers/fujitsu/eternus_dx_iscsi.py +++ b/cinder/volume/drivers/fujitsu/eternus_dx_iscsi.py @@ -18,12 +18,12 @@ ISCSI Drivers for ETERNUS DX arrays based on SMI-S. """ from oslo_concurrency import lockutils +from oslo_log import log as logging import six from cinder import context from cinder import exception from cinder.i18n import _, _LW -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume.drivers.fujitsu import eternus_dx_common diff --git a/cinder/volume/drivers/fusionio/ioControl.py b/cinder/volume/drivers/fusionio/ioControl.py index dc73bf9a7..23e69c782 100644 --- a/cinder/volume/drivers/fusionio/ioControl.py +++ b/cinder/volume/drivers/fusionio/ioControl.py @@ -24,12 +24,12 @@ import random import uuid from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units import requests from cinder import exception from cinder.i18n import _, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder.volume.drivers.san import san from cinder.volume import qos_specs diff --git a/cinder/volume/drivers/glusterfs.py b/cinder/volume/drivers/glusterfs.py index 011c52658..559e12b9b 100644 --- a/cinder/volume/drivers/glusterfs.py +++ b/cinder/volume/drivers/glusterfs.py @@ -19,6 +19,7 @@ import stat from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units from cinder.brick.remotefs import remotefs as remotefs_brick @@ -26,7 +27,6 @@ from cinder import exception from cinder.i18n import _, _LE, _LI, _LW from cinder.image import image_utils from cinder.openstack.common import fileutils -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.drivers import remotefs as remotefs_drv diff --git a/cinder/volume/drivers/hds/hds.py b/cinder/volume/drivers/hds/hds.py index 1a64204f4..1adb06055 100644 --- a/cinder/volume/drivers/hds/hds.py +++ b/cinder/volume/drivers/hds/hds.py @@ -22,11 +22,11 @@ iSCSI Cinder Volume driver for Hitachi Unified Storage (HUS) platform. from xml.etree import ElementTree as ETree from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from cinder import exception from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume import driver from cinder.volume.drivers.hds import hus_backend diff --git a/cinder/volume/drivers/hds/hnas_backend.py b/cinder/volume/drivers/hds/hnas_backend.py index 55423aa32..c548ef62f 100644 --- a/cinder/volume/drivers/hds/hnas_backend.py +++ b/cinder/volume/drivers/hds/hnas_backend.py @@ -21,11 +21,11 @@ Hitachi Unified Storage (HUS-HNAS) platform. Backend operations. import re from oslo_concurrency import processutils +from oslo_log import log as logging from oslo_utils import units import six from cinder.i18n import _LE, _LW, _LI -from cinder.openstack.common import log as logging from cinder import ssh_utils from cinder import utils diff --git a/cinder/volume/drivers/hds/hus_backend.py b/cinder/volume/drivers/hds/hus_backend.py index 4920b8fd5..b29026edf 100644 --- a/cinder/volume/drivers/hds/hus_backend.py +++ b/cinder/volume/drivers/hds/hus_backend.py @@ -19,7 +19,8 @@ Hitachi Unified Storage (HUS) platform. Backend operations. """ -from cinder.openstack.common import log as logging +from oslo_log import log as logging + from cinder import utils LOG = logging.getLogger("cinder.volume.driver") diff --git a/cinder/volume/drivers/hds/iscsi.py b/cinder/volume/drivers/hds/iscsi.py index e44e49155..2cbfeff1a 100644 --- a/cinder/volume/drivers/hds/iscsi.py +++ b/cinder/volume/drivers/hds/iscsi.py @@ -21,12 +21,12 @@ import os from xml.etree import ElementTree as ETree from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume.drivers.hds import hnas_backend from cinder.volume import utils diff --git a/cinder/volume/drivers/hds/nfs.py b/cinder/volume/drivers/hds/nfs.py index e3149f7e1..13d8351a9 100644 --- a/cinder/volume/drivers/hds/nfs.py +++ b/cinder/volume/drivers/hds/nfs.py @@ -23,13 +23,13 @@ from xml.etree import ElementTree as ETree from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units from cinder import exception from cinder.i18n import _, _LE, _LI from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder.volume.drivers.hds import hnas_backend from cinder.volume.drivers import nfs from cinder.volume import utils diff --git a/cinder/volume/drivers/hitachi/hbsd_basiclib.py b/cinder/volume/drivers/hitachi/hbsd_basiclib.py index ee761a8fb..d400faf37 100644 --- a/cinder/volume/drivers/hitachi/hbsd_basiclib.py +++ b/cinder/volume/drivers/hitachi/hbsd_basiclib.py @@ -18,12 +18,12 @@ import shlex from oslo_concurrency import lockutils from oslo_concurrency import processutils as putils +from oslo_log import log as logging from oslo_utils import excutils import six from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder import utils SMPL = 1 diff --git a/cinder/volume/drivers/hitachi/hbsd_common.py b/cinder/volume/drivers/hitachi/hbsd_common.py index 5f8ca164e..0e2444dac 100644 --- a/cinder/volume/drivers/hitachi/hbsd_common.py +++ b/cinder/volume/drivers/hitachi/hbsd_common.py @@ -20,6 +20,7 @@ import re import threading from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils import six @@ -27,7 +28,6 @@ from cinder.db.sqlalchemy import api from cinder.db.sqlalchemy import models from cinder import exception from cinder.i18n import _LE, _LW -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib from cinder.volume.drivers.hitachi import hbsd_horcm as horcm diff --git a/cinder/volume/drivers/hitachi/hbsd_fc.py b/cinder/volume/drivers/hitachi/hbsd_fc.py index 0068bb6e2..1c40aaa4e 100644 --- a/cinder/volume/drivers/hitachi/hbsd_fc.py +++ b/cinder/volume/drivers/hitachi/hbsd_fc.py @@ -20,12 +20,12 @@ import os import threading from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils import six from cinder import exception from cinder.i18n import _LW -from cinder.openstack.common import log as logging from cinder import utils import cinder.volume.driver from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib diff --git a/cinder/volume/drivers/hitachi/hbsd_horcm.py b/cinder/volume/drivers/hitachi/hbsd_horcm.py index 6175d2d63..ca4ebe27d 100644 --- a/cinder/volume/drivers/hitachi/hbsd_horcm.py +++ b/cinder/volume/drivers/hitachi/hbsd_horcm.py @@ -21,13 +21,13 @@ import time from oslo_concurrency import processutils as putils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units import six from cinder import exception from cinder.i18n import _LE, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder import utils from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib diff --git a/cinder/volume/drivers/hitachi/hbsd_iscsi.py b/cinder/volume/drivers/hitachi/hbsd_iscsi.py index 558a27d43..87e99e82f 100644 --- a/cinder/volume/drivers/hitachi/hbsd_iscsi.py +++ b/cinder/volume/drivers/hitachi/hbsd_iscsi.py @@ -20,11 +20,11 @@ import os import threading from oslo_config import cfg +from oslo_log import log as logging import six from cinder import exception from cinder.i18n import _LE -from cinder.openstack.common import log as logging from cinder import utils import cinder.volume.driver from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib diff --git a/cinder/volume/drivers/hitachi/hbsd_snm2.py b/cinder/volume/drivers/hitachi/hbsd_snm2.py index 12ecd20c3..13c32f0b0 100644 --- a/cinder/volume/drivers/hitachi/hbsd_snm2.py +++ b/cinder/volume/drivers/hitachi/hbsd_snm2.py @@ -17,13 +17,13 @@ import shlex import threading import time +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units import six from cinder import exception from cinder.i18n import _LE, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder import utils from cinder.volume.drivers.hitachi import hbsd_basiclib as basic_lib diff --git a/cinder/volume/drivers/huawei/__init__.py b/cinder/volume/drivers/huawei/__init__.py index 2e0895347..92351a805 100644 --- a/cinder/volume/drivers/huawei/__init__.py +++ b/cinder/volume/drivers/huawei/__init__.py @@ -19,11 +19,11 @@ The product type and the protocol should be specified in config file before. """ from oslo_config import cfg +from oslo_log import log as logging import six from cinder import exception from cinder.i18n import _, _LI, _LW -from cinder.openstack.common import log as logging from cinder.volume.drivers.huawei import huawei_18000 from cinder.volume.drivers.huawei import huawei_dorado from cinder.volume.drivers.huawei import huawei_t diff --git a/cinder/volume/drivers/huawei/huawei_dorado.py b/cinder/volume/drivers/huawei/huawei_dorado.py index 6dabedc6b..71966fb21 100644 --- a/cinder/volume/drivers/huawei/huawei_dorado.py +++ b/cinder/volume/drivers/huawei/huawei_dorado.py @@ -19,7 +19,8 @@ Volume Drivers for Huawei OceanStor Dorado series storage arrays. import re -from cinder.openstack.common import log as logging +from oslo_log import log as logging + from cinder.volume.drivers.huawei import huawei_t from cinder.volume.drivers.huawei import ssh_common diff --git a/cinder/volume/drivers/huawei/huawei_t.py b/cinder/volume/drivers/huawei/huawei_t.py index 6be3787d3..356dcf298 100644 --- a/cinder/volume/drivers/huawei/huawei_t.py +++ b/cinder/volume/drivers/huawei/huawei_t.py @@ -20,9 +20,10 @@ Volume Drivers for Huawei OceanStor T series storage arrays. import re import time +from oslo_log import log as logging + from cinder import exception from cinder.i18n import _, _LE, _LW -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume.drivers.huawei import huawei_utils from cinder.volume.drivers.huawei import ssh_common diff --git a/cinder/volume/drivers/huawei/huawei_utils.py b/cinder/volume/drivers/huawei/huawei_utils.py index be3a38406..bec102051 100644 --- a/cinder/volume/drivers/huawei/huawei_utils.py +++ b/cinder/volume/drivers/huawei/huawei_utils.py @@ -16,8 +16,9 @@ from xml.etree import ElementTree as ET +from oslo_log import log as logging + from cinder.i18n import _LE -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/huawei/rest_common.py b/cinder/volume/drivers/huawei/rest_common.py index 2f64d4e69..672cf84eb 100644 --- a/cinder/volume/drivers/huawei/rest_common.py +++ b/cinder/volume/drivers/huawei/rest_common.py @@ -22,6 +22,7 @@ import urllib2 import uuid from xml.etree import ElementTree as ET +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units import six @@ -29,7 +30,6 @@ import six from cinder import context from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder import utils from cinder.volume import qos_specs diff --git a/cinder/volume/drivers/huawei/ssh_common.py b/cinder/volume/drivers/huawei/ssh_common.py index 4f2ce6075..1aa0ef2ad 100644 --- a/cinder/volume/drivers/huawei/ssh_common.py +++ b/cinder/volume/drivers/huawei/ssh_common.py @@ -26,12 +26,12 @@ import threading import time from xml.etree import ElementTree as ET +from oslo_log import log as logging from oslo_utils import excutils from cinder import context from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder import ssh_utils from cinder import utils from cinder.volume.drivers.huawei import huawei_utils diff --git a/cinder/volume/drivers/ibm/flashsystem.py b/cinder/volume/drivers/ibm/flashsystem.py index f08b4e809..86254eab0 100644 --- a/cinder/volume/drivers/ibm/flashsystem.py +++ b/cinder/volume/drivers/ibm/flashsystem.py @@ -30,6 +30,7 @@ import threading from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units import six @@ -37,7 +38,6 @@ import six from cinder import context from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder.openstack.common import strutils from cinder import utils diff --git a/cinder/volume/drivers/ibm/gpfs.py b/cinder/volume/drivers/ibm/gpfs.py index f52d55b58..2ea30b3df 100644 --- a/cinder/volume/drivers/ibm/gpfs.py +++ b/cinder/volume/drivers/ibm/gpfs.py @@ -23,6 +23,7 @@ import shutil from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units import six @@ -31,7 +32,6 @@ from cinder import exception from cinder.i18n import _, _LE, _LI from cinder.image import image_utils from cinder.openstack.common import fileutils -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume import driver diff --git a/cinder/volume/drivers/ibm/ibmnas.py b/cinder/volume/drivers/ibm/ibmnas.py index 98e721c42..5297418fb 100644 --- a/cinder/volume/drivers/ibm/ibmnas.py +++ b/cinder/volume/drivers/ibm/ibmnas.py @@ -34,12 +34,12 @@ import re from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units from cinder import exception from cinder.i18n import _, _LI, _LW from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.drivers import nfs from cinder.volume.drivers import remotefs diff --git a/cinder/volume/drivers/ibm/storwize_svc/__init__.py b/cinder/volume/drivers/ibm/storwize_svc/__init__.py index d2d70cc61..499a25fd3 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/__init__.py +++ b/cinder/volume/drivers/ibm/storwize_svc/__init__.py @@ -38,13 +38,13 @@ import math import time from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units from cinder import context from cinder import exception from cinder.i18n import _, _LE, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder import utils from cinder.volume.drivers.ibm.storwize_svc import helpers as storwize_helpers diff --git a/cinder/volume/drivers/ibm/storwize_svc/helpers.py b/cinder/volume/drivers/ibm/storwize_svc/helpers.py index ab5928a47..9f451f8c1 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/helpers.py +++ b/cinder/volume/drivers/ibm/storwize_svc/helpers.py @@ -21,6 +21,7 @@ import unicodedata from eventlet import greenthread +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import strutils import six @@ -28,7 +29,6 @@ import six from cinder import context from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder.volume.drivers.ibm.storwize_svc import ssh as storwize_ssh from cinder.volume import qos_specs diff --git a/cinder/volume/drivers/ibm/storwize_svc/replication.py b/cinder/volume/drivers/ibm/storwize_svc/replication.py index a05b44ded..faa811509 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/replication.py +++ b/cinder/volume/drivers/ibm/storwize_svc/replication.py @@ -14,9 +14,10 @@ # under the License. # +from oslo_log import log as logging + from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder.volume import volume_types LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/ibm/storwize_svc/ssh.py b/cinder/volume/drivers/ibm/storwize_svc/ssh.py index 49da20c87..a0cf01bd5 100644 --- a/cinder/volume/drivers/ibm/storwize_svc/ssh.py +++ b/cinder/volume/drivers/ibm/storwize_svc/ssh.py @@ -17,10 +17,10 @@ import re from oslo_concurrency import processutils +from oslo_log import log as logging from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/ibm/xiv_ds8k.py b/cinder/volume/drivers/ibm/xiv_ds8k.py index 93228a940..1d44eda64 100644 --- a/cinder/volume/drivers/ibm/xiv_ds8k.py +++ b/cinder/volume/drivers/ibm/xiv_ds8k.py @@ -23,10 +23,10 @@ Unified Volume driver for IBM XIV and DS8K Storage Systems. """ from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import importutils from cinder import exception -from cinder.openstack.common import log as logging from cinder.volume.drivers.san import san xiv_ds8k_opts = [ diff --git a/cinder/volume/drivers/lvm.py b/cinder/volume/drivers/lvm.py index 339da1c28..369899304 100644 --- a/cinder/volume/drivers/lvm.py +++ b/cinder/volume/drivers/lvm.py @@ -21,6 +21,7 @@ import socket from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import importutils from oslo_utils import units @@ -30,7 +31,6 @@ from cinder import exception from cinder.i18n import _, _LE, _LI, _LW from cinder.image import image_utils from cinder.openstack.common import fileutils -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume import driver from cinder.volume import utils as volutils diff --git a/cinder/volume/drivers/netapp/common.py b/cinder/volume/drivers/netapp/common.py index 875fee1c1..d20a0e5e8 100644 --- a/cinder/volume/drivers/netapp/common.py +++ b/cinder/volume/drivers/netapp/common.py @@ -18,11 +18,11 @@ Unified driver for NetApp storage systems. Supports multiple storage systems of different families and protocols. """ +from oslo_log import log as logging from oslo_utils import importutils from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume.drivers.netapp import options from cinder.volume.drivers.netapp import utils as na_utils diff --git a/cinder/volume/drivers/netapp/dataontap/block_7mode.py b/cinder/volume/drivers/netapp/dataontap/block_7mode.py index 64eb31a0e..8f11aa028 100644 --- a/cinder/volume/drivers/netapp/dataontap/block_7mode.py +++ b/cinder/volume/drivers/netapp/dataontap/block_7mode.py @@ -21,13 +21,13 @@ Volume driver library for NetApp 7-mode block storage systems. """ +from oslo_log import log as logging from oslo_utils import timeutils from oslo_utils import units import six from cinder import exception from cinder.i18n import _, _LW -from cinder.openstack.common import log as logging from cinder.volume import configuration from cinder.volume.drivers.netapp.dataontap import block_base from cinder.volume.drivers.netapp.dataontap.client import client_7mode diff --git a/cinder/volume/drivers/netapp/dataontap/block_base.py b/cinder/volume/drivers/netapp/dataontap/block_base.py index 298c1c84a..8eb754487 100644 --- a/cinder/volume/drivers/netapp/dataontap/block_base.py +++ b/cinder/volume/drivers/netapp/dataontap/block_base.py @@ -25,13 +25,13 @@ import math import sys import uuid +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units import six from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.volume.drivers.netapp.dataontap.client import api as na_api from cinder.volume.drivers.netapp import options as na_opts from cinder.volume.drivers.netapp import utils as na_utils diff --git a/cinder/volume/drivers/netapp/dataontap/block_cmode.py b/cinder/volume/drivers/netapp/dataontap/block_cmode.py index d7468509a..af9abca2c 100644 --- a/cinder/volume/drivers/netapp/dataontap/block_cmode.py +++ b/cinder/volume/drivers/netapp/dataontap/block_cmode.py @@ -23,12 +23,12 @@ Volume driver library for NetApp C-mode block storage systems. import copy +from oslo_log import log as logging from oslo_utils import units import six from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.drivers.netapp.dataontap import block_base from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api diff --git a/cinder/volume/drivers/netapp/dataontap/client/api.py b/cinder/volume/drivers/netapp/dataontap/client/api.py index 92a720d88..7dbe18134 100644 --- a/cinder/volume/drivers/netapp/dataontap/client/api.py +++ b/cinder/volume/drivers/netapp/dataontap/client/api.py @@ -24,11 +24,11 @@ import copy import urllib2 from lxml import etree +from oslo_log import log as logging import six from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/netapp/dataontap/client/client_7mode.py b/cinder/volume/drivers/netapp/dataontap/client/client_7mode.py index 207a1a0f7..5ad8d8e24 100644 --- a/cinder/volume/drivers/netapp/dataontap/client/client_7mode.py +++ b/cinder/volume/drivers/netapp/dataontap/client/client_7mode.py @@ -18,11 +18,11 @@ import copy import math import time +from oslo_log import log as logging import six from cinder import exception from cinder.i18n import _, _LW -from cinder.openstack.common import log as logging from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api from cinder.volume.drivers.netapp.dataontap.client import client_base diff --git a/cinder/volume/drivers/netapp/dataontap/client/client_base.py b/cinder/volume/drivers/netapp/dataontap/client/client_base.py index f6ec288f4..c8ac0f047 100644 --- a/cinder/volume/drivers/netapp/dataontap/client/client_base.py +++ b/cinder/volume/drivers/netapp/dataontap/client/client_base.py @@ -17,12 +17,12 @@ import copy import socket import sys +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import timeutils import six from cinder.i18n import _LE, _LW, _LI -from cinder.openstack.common import log as logging from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api diff --git a/cinder/volume/drivers/netapp/dataontap/client/client_cmode.py b/cinder/volume/drivers/netapp/dataontap/client/client_cmode.py index 63a03980e..00b32fd5a 100644 --- a/cinder/volume/drivers/netapp/dataontap/client/client_cmode.py +++ b/cinder/volume/drivers/netapp/dataontap/client/client_cmode.py @@ -17,11 +17,11 @@ import copy import math +from oslo_log import log as logging import six from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api from cinder.volume.drivers.netapp.dataontap.client import client_base from cinder.volume.drivers.netapp import utils as na_utils diff --git a/cinder/volume/drivers/netapp/dataontap/fc_7mode.py b/cinder/volume/drivers/netapp/dataontap/fc_7mode.py index d0b34b8d3..4bf2f8409 100644 --- a/cinder/volume/drivers/netapp/dataontap/fc_7mode.py +++ b/cinder/volume/drivers/netapp/dataontap/fc_7mode.py @@ -15,7 +15,8 @@ Volume driver for NetApp Data ONTAP (7-mode) FibreChannel storage systems. """ -from cinder.openstack.common import log as logging +from oslo_log import log as logging + from cinder.volume import driver from cinder.volume.drivers.netapp.dataontap import block_7mode from cinder.zonemanager import utils as fczm_utils diff --git a/cinder/volume/drivers/netapp/dataontap/fc_cmode.py b/cinder/volume/drivers/netapp/dataontap/fc_cmode.py index e7c77e0b2..b7ef1dc82 100644 --- a/cinder/volume/drivers/netapp/dataontap/fc_cmode.py +++ b/cinder/volume/drivers/netapp/dataontap/fc_cmode.py @@ -15,7 +15,8 @@ Volume driver for NetApp Data ONTAP (C-mode) FibreChannel storage systems. """ -from cinder.openstack.common import log as logging +from oslo_log import log as logging + from cinder.volume import driver from cinder.volume.drivers.netapp.dataontap import block_cmode from cinder.zonemanager import utils as fczm_utils diff --git a/cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py b/cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py index 64ad6966f..2a200f1cb 100644 --- a/cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py +++ b/cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py @@ -15,7 +15,8 @@ Volume driver for NetApp Data ONTAP (7-mode) iSCSI storage systems. """ -from cinder.openstack.common import log as logging +from oslo_log import log as logging + from cinder.volume import driver from cinder.volume.drivers.netapp.dataontap import block_7mode diff --git a/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py b/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py index a56428508..482d05522 100644 --- a/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py +++ b/cinder/volume/drivers/netapp/dataontap/iscsi_cmode.py @@ -15,7 +15,8 @@ Volume driver for NetApp Data ONTAP (C-mode) iSCSI storage systems. """ -from cinder.openstack.common import log as logging +from oslo_log import log as logging + from cinder.volume import driver from cinder.volume.drivers.netapp.dataontap import block_cmode diff --git a/cinder/volume/drivers/netapp/dataontap/nfs_7mode.py b/cinder/volume/drivers/netapp/dataontap/nfs_7mode.py index 47a8581db..a1bada031 100644 --- a/cinder/volume/drivers/netapp/dataontap/nfs_7mode.py +++ b/cinder/volume/drivers/netapp/dataontap/nfs_7mode.py @@ -20,12 +20,12 @@ Volume driver for NetApp NFS storage. """ +from oslo_log import log as logging from oslo_utils import units import six from cinder import exception from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder.volume.drivers.netapp.dataontap.client import client_7mode from cinder.volume.drivers.netapp.dataontap import nfs_base from cinder.volume.drivers.netapp import options as na_opts diff --git a/cinder/volume/drivers/netapp/dataontap/nfs_base.py b/cinder/volume/drivers/netapp/dataontap/nfs_base.py index 24d112ba5..8472f82a2 100644 --- a/cinder/volume/drivers/netapp/dataontap/nfs_base.py +++ b/cinder/volume/drivers/netapp/dataontap/nfs_base.py @@ -29,6 +29,7 @@ import time from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units import six.moves.urllib.parse as urlparse @@ -36,7 +37,6 @@ import six.moves.urllib.parse as urlparse from cinder import exception from cinder.i18n import _, _LE, _LI, _LW from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.drivers.netapp import options as na_opts from cinder.volume.drivers.netapp import utils as na_utils diff --git a/cinder/volume/drivers/netapp/dataontap/nfs_cmode.py b/cinder/volume/drivers/netapp/dataontap/nfs_cmode.py index 21c8aca6a..18c7409e0 100644 --- a/cinder/volume/drivers/netapp/dataontap/nfs_cmode.py +++ b/cinder/volume/drivers/netapp/dataontap/nfs_cmode.py @@ -23,13 +23,13 @@ Volume driver for NetApp NFS storage. import os import uuid +from oslo_log import log as logging from oslo_utils import units import six from cinder import exception from cinder.i18n import _, _LE, _LI, _LW from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.drivers.netapp.dataontap.client import api as na_api from cinder.volume.drivers.netapp.dataontap.client import client_cmode diff --git a/cinder/volume/drivers/netapp/dataontap/ssc_cmode.py b/cinder/volume/drivers/netapp/dataontap/ssc_cmode.py index ae9ac0914..3463ff0db 100644 --- a/cinder/volume/drivers/netapp/dataontap/ssc_cmode.py +++ b/cinder/volume/drivers/netapp/dataontap/ssc_cmode.py @@ -21,12 +21,12 @@ Storage service catalog utility functions and classes for NetApp systems. import copy import threading +from oslo_log import log as logging from oslo_utils import timeutils import six from cinder import exception from cinder.i18n import _, _LI, _LW -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.drivers.netapp.dataontap.client import api as netapp_api from cinder.volume.drivers.netapp import utils as na_utils diff --git a/cinder/volume/drivers/netapp/eseries/client.py b/cinder/volume/drivers/netapp/eseries/client.py index 268fb85a4..3f773af48 100644 --- a/cinder/volume/drivers/netapp/eseries/client.py +++ b/cinder/volume/drivers/netapp/eseries/client.py @@ -21,12 +21,12 @@ Client classes for web services. import copy import json +from oslo_log import log as logging import requests import six.moves.urllib.parse as urlparse from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/netapp/eseries/iscsi.py b/cinder/volume/drivers/netapp/eseries/iscsi.py index 5e5712229..0cb3e1959 100644 --- a/cinder/volume/drivers/netapp/eseries/iscsi.py +++ b/cinder/volume/drivers/netapp/eseries/iscsi.py @@ -25,13 +25,13 @@ import time import uuid from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units import six from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder import utils as cinder_utils from cinder.volume import driver diff --git a/cinder/volume/drivers/netapp/eseries/utils.py b/cinder/volume/drivers/netapp/eseries/utils.py index 8ef3655b5..4f343d4f4 100644 --- a/cinder/volume/drivers/netapp/eseries/utils.py +++ b/cinder/volume/drivers/netapp/eseries/utils.py @@ -20,10 +20,9 @@ import base64 import binascii import uuid +from oslo_log import log as logging import six -from cinder.openstack.common import log as logging - LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/netapp/utils.py b/cinder/volume/drivers/netapp/utils.py index 3afd70a65..ef2713864 100644 --- a/cinder/volume/drivers/netapp/utils.py +++ b/cinder/volume/drivers/netapp/utils.py @@ -26,12 +26,12 @@ import platform import socket from oslo_concurrency import processutils as putils +from oslo_log import log as logging import six from cinder import context from cinder import exception from cinder.i18n import _, _LW, _LI -from cinder.openstack.common import log as logging from cinder import utils from cinder import version from cinder.volume import volume_types diff --git a/cinder/volume/drivers/nexenta/iscsi.py b/cinder/volume/drivers/nexenta/iscsi.py index a48fb05e3..722a7f899 100644 --- a/cinder/volume/drivers/nexenta/iscsi.py +++ b/cinder/volume/drivers/nexenta/iscsi.py @@ -22,9 +22,10 @@ .. moduleauthor:: Yuriy Taraday """ +from oslo_log import log as logging + from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume.drivers import nexenta from cinder.volume.drivers.nexenta import jsonrpc diff --git a/cinder/volume/drivers/nexenta/jsonrpc.py b/cinder/volume/drivers/nexenta/jsonrpc.py index 8da767662..49a3067e6 100644 --- a/cinder/volume/drivers/nexenta/jsonrpc.py +++ b/cinder/volume/drivers/nexenta/jsonrpc.py @@ -23,10 +23,10 @@ import urllib2 +from oslo_log import log as logging from oslo_serialization import jsonutils from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder.volume.drivers import nexenta LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/nexenta/nfs.py b/cinder/volume/drivers/nexenta/nfs.py index 1419c2796..6fe572233 100644 --- a/cinder/volume/drivers/nexenta/nfs.py +++ b/cinder/volume/drivers/nexenta/nfs.py @@ -25,13 +25,13 @@ import hashlib import os import re +from oslo_log import log as logging from oslo_utils import units from cinder import context from cinder import db from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.volume.drivers import nexenta from cinder.volume.drivers.nexenta import jsonrpc from cinder.volume.drivers.nexenta import options diff --git a/cinder/volume/drivers/nfs.py b/cinder/volume/drivers/nfs.py index 43880fd0f..627fbc344 100644 --- a/cinder/volume/drivers/nfs.py +++ b/cinder/volume/drivers/nfs.py @@ -19,6 +19,7 @@ import time from oslo_concurrency import processutils as putils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units import six @@ -26,7 +27,6 @@ from cinder.brick.remotefs import remotefs as remotefs_brick from cinder import exception from cinder.i18n import _, _LE, _LI, _LW from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.drivers import remotefs diff --git a/cinder/volume/drivers/nimble.py b/cinder/volume/drivers/nimble.py index 5315bcbac..18ce0103e 100644 --- a/cinder/volume/drivers/nimble.py +++ b/cinder/volume/drivers/nimble.py @@ -25,12 +25,12 @@ import string import urllib2 from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units from suds import client from cinder import exception from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder.volume.drivers.san import san diff --git a/cinder/volume/drivers/openvstorage.py b/cinder/volume/drivers/openvstorage.py index ee361c152..7dc643d84 100644 --- a/cinder/volume/drivers/openvstorage.py +++ b/cinder/volume/drivers/openvstorage.py @@ -38,12 +38,12 @@ except ImportError: vdisklib = None from oslo_config import cfg +from oslo_log import log as logging import six from cinder import exception from cinder.i18n import _ from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder.volume import driver diff --git a/cinder/volume/drivers/prophetstor/dpl_fc.py b/cinder/volume/drivers/prophetstor/dpl_fc.py index 3e6927612..f2875839e 100644 --- a/cinder/volume/drivers/prophetstor/dpl_fc.py +++ b/cinder/volume/drivers/prophetstor/dpl_fc.py @@ -15,10 +15,10 @@ import errno +from oslo_log import log as logging from cinder import exception from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume.drivers.prophetstor import dplcommon from cinder.zonemanager import utils as fczm_utils diff --git a/cinder/volume/drivers/prophetstor/dpl_iscsi.py b/cinder/volume/drivers/prophetstor/dpl_iscsi.py index 98ae9340a..3a3b1411f 100644 --- a/cinder/volume/drivers/prophetstor/dpl_iscsi.py +++ b/cinder/volume/drivers/prophetstor/dpl_iscsi.py @@ -15,9 +15,10 @@ import errno +from oslo_log import log as logging + from cinder import exception from cinder.i18n import _, _LI, _LW -from cinder.openstack.common import log as logging import cinder.volume.driver from cinder.volume.drivers.prophetstor import dplcommon diff --git a/cinder/volume/drivers/prophetstor/dplcommon.py b/cinder/volume/drivers/prophetstor/dplcommon.py index 1bf34a012..b58980b7a 100644 --- a/cinder/volume/drivers/prophetstor/dplcommon.py +++ b/cinder/volume/drivers/prophetstor/dplcommon.py @@ -25,12 +25,12 @@ import json import random import time +from oslo_log import log as logging from oslo_utils import units import six from cinder import exception from cinder.i18n import _, _LI, _LW, _LE -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder.volume import driver from cinder.volume.drivers.prophetstor import options diff --git a/cinder/volume/drivers/pure.py b/cinder/volume/drivers/pure.py index ec2cf9f9f..611ddeb3c 100644 --- a/cinder/volume/drivers/pure.py +++ b/cinder/volume/drivers/pure.py @@ -24,12 +24,12 @@ import uuid from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.drivers.san import san from cinder.volume import utils as volume_utils diff --git a/cinder/volume/drivers/quobyte.py b/cinder/volume/drivers/quobyte.py index caf3a78e2..694df0041 100644 --- a/cinder/volume/drivers/quobyte.py +++ b/cinder/volume/drivers/quobyte.py @@ -19,13 +19,13 @@ import os from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from cinder import compute from cinder import exception from cinder.i18n import _, _LI, _LW from cinder.image import image_utils from cinder.openstack.common import fileutils -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.drivers import remotefs as remotefs_drv diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py index 55a626b74..52b6cb08a 100644 --- a/cinder/volume/drivers/rbd.py +++ b/cinder/volume/drivers/rbd.py @@ -22,6 +22,7 @@ import tempfile import urllib from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import encodeutils from oslo_utils import units import six @@ -30,7 +31,6 @@ from cinder import exception from cinder.i18n import _, _LE, _LI, _LW from cinder.image import image_utils from cinder.openstack.common import fileutils -from cinder.openstack.common import log as logging from cinder.volume import driver try: diff --git a/cinder/volume/drivers/remotefs.py b/cinder/volume/drivers/remotefs.py index a9719140c..c9655feb7 100644 --- a/cinder/volume/drivers/remotefs.py +++ b/cinder/volume/drivers/remotefs.py @@ -23,6 +23,7 @@ import time from oslo_concurrency import processutils as putils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units from cinder import compute @@ -30,7 +31,6 @@ from cinder import db from cinder import exception from cinder.i18n import _, _LE, _LI, _LW from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder.volume import driver LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/san/hp/hp_3par_common.py b/cinder/volume/drivers/san/hp/hp_3par_common.py index ab9eef6e0..27e9ac99f 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_common.py +++ b/cinder/volume/drivers/san/hp/hp_3par_common.py @@ -50,6 +50,7 @@ if hp3parclient: from hp3parclient import exceptions as hpexceptions from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units @@ -57,7 +58,6 @@ from cinder import context from cinder import exception from cinder import flow_utils from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder.volume import qos_specs from cinder.volume import utils as volume_utils diff --git a/cinder/volume/drivers/san/hp/hp_3par_fc.py b/cinder/volume/drivers/san/hp/hp_3par_fc.py index f43c70881..afebdbf8f 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_fc.py +++ b/cinder/volume/drivers/san/hp/hp_3par_fc.py @@ -34,9 +34,10 @@ try: except ImportError: hpexceptions = None +from oslo_log import log as logging + from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging import cinder.volume.driver from cinder.volume.drivers.san.hp import hp_3par_common as hpcommon from cinder.volume.drivers.san import san diff --git a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py index a41dda584..8eea79afa 100644 --- a/cinder/volume/drivers/san/hp/hp_3par_iscsi.py +++ b/cinder/volume/drivers/san/hp/hp_3par_iscsi.py @@ -35,9 +35,10 @@ try: except ImportError: hpexceptions = None +from oslo_log import log as logging + from cinder import exception from cinder.i18n import _, _LE, _LW -from cinder.openstack.common import log as logging import cinder.volume.driver from cinder.volume.drivers.san.hp import hp_3par_common as hpcommon from cinder.volume.drivers.san import san diff --git a/cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py b/cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py index 32176ae53..d3f4fdbfb 100644 --- a/cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py +++ b/cinder/volume/drivers/san/hp/hp_lefthand_cliq_proxy.py @@ -22,11 +22,11 @@ operations on the SAN. from lxml import etree from oslo_concurrency import processutils +from oslo_log import log as logging from oslo_utils import units from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder.volume.drivers.san import san diff --git a/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py b/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py index 9d84bca55..c4188f11f 100644 --- a/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py +++ b/cinder/volume/drivers/san/hp/hp_lefthand_iscsi.py @@ -31,9 +31,11 @@ It also requires the setting of hplefthand_api_url, hplefthand_username, hplefthand_password for credentials to talk to the REST service on the LeftHand array. """ + +from oslo_log import log as logging + from cinder import exception from cinder.i18n import _LE, _LI -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume.drivers.san.hp import hp_lefthand_cliq_proxy as cliq_proxy from cinder.volume.drivers.san.hp import hp_lefthand_rest_proxy as rest_proxy diff --git a/cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py b/cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py index 88ded9ca9..97b518555 100644 --- a/cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py +++ b/cinder/volume/drivers/san/hp/hp_lefthand_rest_proxy.py @@ -16,6 +16,7 @@ """HP LeftHand SAN ISCSI REST Proxy.""" from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import importutils from oslo_utils import units @@ -23,7 +24,6 @@ from oslo_utils import units from cinder import context from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume import utils from cinder.volume import volume_types diff --git a/cinder/volume/drivers/san/hp/hp_msa_common.py b/cinder/volume/drivers/san/hp/hp_msa_common.py index 11e98985f..bf4b6f0aa 100644 --- a/cinder/volume/drivers/san/hp/hp_msa_common.py +++ b/cinder/volume/drivers/san/hp/hp_msa_common.py @@ -20,10 +20,10 @@ import base64 import uuid from oslo_config import cfg +from oslo_log import log as logging from cinder import exception from cinder.i18n import _LE -from cinder.openstack.common import log as logging from cinder.volume.drivers.san.hp import hp_msa_client as msa LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/san/hp/hp_msa_fc.py b/cinder/volume/drivers/san/hp/hp_msa_fc.py index 1b1657122..347c35d66 100644 --- a/cinder/volume/drivers/san/hp/hp_msa_fc.py +++ b/cinder/volume/drivers/san/hp/hp_msa_fc.py @@ -13,7 +13,8 @@ # under the License. # -from cinder.openstack.common import log as logging +from oslo_log import log as logging + from cinder import utils import cinder.volume.driver from cinder.volume.drivers.san.hp import hp_msa_common as hpcommon diff --git a/cinder/volume/drivers/san/san.py b/cinder/volume/drivers/san/san.py index f5adc86b8..85ead139e 100644 --- a/cinder/volume/drivers/san/san.py +++ b/cinder/volume/drivers/san/san.py @@ -24,11 +24,11 @@ import random from eventlet import greenthread from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder import ssh_utils from cinder import utils from cinder.volume import driver diff --git a/cinder/volume/drivers/scality.py b/cinder/volume/drivers/scality.py index 7e088a7ac..e4ae636cd 100644 --- a/cinder/volume/drivers/scality.py +++ b/cinder/volume/drivers/scality.py @@ -23,6 +23,7 @@ import urllib2 from oslo_concurrency import lockutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units import six.moves.urllib.parse as urlparse @@ -30,7 +31,6 @@ from cinder import exception from cinder.i18n import _, _LI from cinder.image import image_utils from cinder.openstack.common import fileutils -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume import driver diff --git a/cinder/volume/drivers/sheepdog.py b/cinder/volume/drivers/sheepdog.py index 21d46f9b1..959f9e54d 100644 --- a/cinder/volume/drivers/sheepdog.py +++ b/cinder/volume/drivers/sheepdog.py @@ -22,12 +22,12 @@ import re from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units from cinder import exception from cinder.i18n import _, _LE from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder.volume import driver diff --git a/cinder/volume/drivers/smbfs.py b/cinder/volume/drivers/smbfs.py index 4c4a3ea2a..b3808b340 100644 --- a/cinder/volume/drivers/smbfs.py +++ b/cinder/volume/drivers/smbfs.py @@ -18,13 +18,13 @@ import re from oslo_concurrency import processutils as putils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units from cinder.brick.remotefs import remotefs from cinder import exception from cinder.i18n import _, _LI, _LW from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.drivers import remotefs as remotefs_drv diff --git a/cinder/volume/drivers/solidfire.py b/cinder/volume/drivers/solidfire.py index 4935eb2d7..0a1e09399 100644 --- a/cinder/volume/drivers/solidfire.py +++ b/cinder/volume/drivers/solidfire.py @@ -21,6 +21,7 @@ import string import time from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import timeutils from oslo_utils import units import requests @@ -30,7 +31,6 @@ from cinder import context from cinder import exception from cinder.i18n import _, _LE, _LI, _LW from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder.volume.drivers.san import san from cinder.volume import qos_specs from cinder.volume import volume_types diff --git a/cinder/volume/drivers/srb.py b/cinder/volume/drivers/srb.py index 45a326bb2..85cc4979a 100644 --- a/cinder/volume/drivers/srb.py +++ b/cinder/volume/drivers/srb.py @@ -28,6 +28,7 @@ import time from oslo_concurrency import lockutils from oslo_concurrency import processutils as putils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units import six @@ -36,7 +37,6 @@ from cinder.brick.local_dev import lvm from cinder import exception from cinder.i18n import _, _LI, _LE, _LW from cinder.image import image_utils -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume import driver from cinder.volume import utils as volutils diff --git a/cinder/volume/drivers/storpool.py b/cinder/volume/drivers/storpool.py index c5d75700e..4abfe644e 100644 --- a/cinder/volume/drivers/storpool.py +++ b/cinder/volume/drivers/storpool.py @@ -18,13 +18,13 @@ from __future__ import absolute_import from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import importutils from oslo_utils import units import six from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume import volume_types diff --git a/cinder/volume/drivers/symantec_cnfs.py b/cinder/volume/drivers/symantec_cnfs.py index b11db3fda..81cb93e4d 100644 --- a/cinder/volume/drivers/symantec_cnfs.py +++ b/cinder/volume/drivers/symantec_cnfs.py @@ -15,9 +15,10 @@ import os +from oslo_log import log as logging + from cinder import exception from cinder.i18n import _, _LW -from cinder.openstack.common import log as logging from cinder.volume.drivers import nfs LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/violin/v6000_common.py b/cinder/volume/drivers/violin/v6000_common.py index 1ecdfb37e..162383933 100644 --- a/cinder/volume/drivers/violin/v6000_common.py +++ b/cinder/volume/drivers/violin/v6000_common.py @@ -32,11 +32,11 @@ import re import time from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import importutils from cinder import exception from cinder.i18n import _, _LE, _LW, _LI -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder import utils diff --git a/cinder/volume/drivers/violin/v6000_fcp.py b/cinder/volume/drivers/violin/v6000_fcp.py index 59e2fc542..e13a30142 100644 --- a/cinder/volume/drivers/violin/v6000_fcp.py +++ b/cinder/volume/drivers/violin/v6000_fcp.py @@ -35,13 +35,13 @@ properly in an active-active HA configuration. See OpenStack Cinder driver documentation for more information. """ +from oslo_log import log as logging from oslo_utils import units from cinder import context from cinder.db.sqlalchemy import models from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume import driver from cinder.volume.drivers.san import san diff --git a/cinder/volume/drivers/violin/v6000_iscsi.py b/cinder/volume/drivers/violin/v6000_iscsi.py index ce4e27ac6..d90fc48df 100644 --- a/cinder/volume/drivers/violin/v6000_iscsi.py +++ b/cinder/volume/drivers/violin/v6000_iscsi.py @@ -36,13 +36,13 @@ driver documentation for more information. import random +from oslo_log import log as logging from oslo_utils import units from cinder import context from cinder.db.sqlalchemy import models from cinder import exception from cinder.i18n import _, _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder import utils from cinder.volume import driver diff --git a/cinder/volume/drivers/vmware/datastore.py b/cinder/volume/drivers/vmware/datastore.py index 2ee8218cc..0f3a914fc 100644 --- a/cinder/volume/drivers/vmware/datastore.py +++ b/cinder/volume/drivers/vmware/datastore.py @@ -17,12 +17,12 @@ Classes and utility methods for datastore selection. """ +from oslo_log import log as logging from oslo_utils import excutils from oslo_vmware import exceptions from oslo_vmware import pbm from cinder.i18n import _LE, _LW -from cinder.openstack.common import log as logging from cinder.volume.drivers.vmware import exceptions as vmdk_exceptions diff --git a/cinder/volume/drivers/vmware/vmdk.py b/cinder/volume/drivers/vmware/vmdk.py index ca555a67f..02a87e87c 100644 --- a/cinder/volume/drivers/vmware/vmdk.py +++ b/cinder/volume/drivers/vmware/vmdk.py @@ -28,6 +28,7 @@ import os import tempfile from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import units from oslo_utils import uuidutils @@ -41,7 +42,6 @@ import six from cinder import exception from cinder.i18n import _, _LE, _LI, _LW from cinder.openstack.common import fileutils -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume.drivers.vmware import datastore as hub from cinder.volume.drivers.vmware import volumeops diff --git a/cinder/volume/drivers/vmware/volumeops.py b/cinder/volume/drivers/vmware/volumeops.py index 024dea294..073f8481f 100644 --- a/cinder/volume/drivers/vmware/volumeops.py +++ b/cinder/volume/drivers/vmware/volumeops.py @@ -19,12 +19,12 @@ Implements operations on volumes residing on VMware datastores. import urllib +from oslo_log import log as logging from oslo_utils import units from oslo_vmware import exceptions from oslo_vmware import vim_util from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder.volume.drivers.vmware import exceptions as vmdk_exceptions diff --git a/cinder/volume/drivers/windows/remotefs.py b/cinder/volume/drivers/windows/remotefs.py index 0afa4d498..c3acc41c7 100644 --- a/cinder/volume/drivers/windows/remotefs.py +++ b/cinder/volume/drivers/windows/remotefs.py @@ -19,10 +19,11 @@ import sys if sys.platform == 'win32': import wmi +from oslo_log import log as logging + from cinder.brick.remotefs import remotefs from cinder import exception from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/windows/smbfs.py b/cinder/volume/drivers/windows/smbfs.py index 30c93644c..8ec9688ca 100644 --- a/cinder/volume/drivers/windows/smbfs.py +++ b/cinder/volume/drivers/windows/smbfs.py @@ -19,13 +19,13 @@ import re import sys from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import units from cinder import exception from cinder.i18n import _ from cinder.image import image_utils from cinder.openstack.common import fileutils -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.drivers import smbfs from cinder.volume.drivers.windows import remotefs diff --git a/cinder/volume/drivers/windows/vhdutils.py b/cinder/volume/drivers/windows/vhdutils.py index cd72475c7..64fd511c8 100644 --- a/cinder/volume/drivers/windows/vhdutils.py +++ b/cinder/volume/drivers/windows/vhdutils.py @@ -33,9 +33,10 @@ if os.name == 'nt': kernel32 = ctypes.windll.kernel32 virtdisk = ctypes.windll.virtdisk +from oslo_log import log as logging + from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder.volume.drivers.windows import constants LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/windows/windows.py b/cinder/volume/drivers/windows/windows.py index 5aee1fff0..b3d7f3a68 100644 --- a/cinder/volume/drivers/windows/windows.py +++ b/cinder/volume/drivers/windows/windows.py @@ -22,10 +22,10 @@ This driver requires ISCSI target role installed import os from oslo_config import cfg +from oslo_log import log as logging from cinder.image import image_utils from cinder.openstack.common import fileutils -from cinder.openstack.common import log as logging from cinder.volume import driver from cinder.volume.drivers.windows import constants from cinder.volume.drivers.windows import vhdutils diff --git a/cinder/volume/drivers/windows/windows_utils.py b/cinder/volume/drivers/windows/windows_utils.py index b518ee67d..99348552b 100644 --- a/cinder/volume/drivers/windows/windows_utils.py +++ b/cinder/volume/drivers/windows/windows_utils.py @@ -20,10 +20,10 @@ import ctypes import os from oslo_config import cfg +from oslo_log import log as logging from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder.volume.drivers.windows import constants # Check needed for unit testing on Unix diff --git a/cinder/volume/drivers/xio.py b/cinder/volume/drivers/xio.py index 48e3c778c..e945ed4b4 100644 --- a/cinder/volume/drivers/xio.py +++ b/cinder/volume/drivers/xio.py @@ -19,11 +19,11 @@ import urllib2 from lxml import etree from oslo_config import cfg +from oslo_log import log as logging from cinder import context from cinder import exception from cinder.i18n import _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder.openstack.common import loopingcall from cinder.volume import driver from cinder.volume.drivers.san import san diff --git a/cinder/volume/drivers/zadara.py b/cinder/volume/drivers/zadara.py index 4b3eeea73..50bad0721 100644 --- a/cinder/volume/drivers/zadara.py +++ b/cinder/volume/drivers/zadara.py @@ -24,10 +24,10 @@ import httplib from lxml import etree from oslo_config import cfg +from oslo_log import log as logging from cinder import exception from cinder.i18n import _, _LW -from cinder.openstack.common import log as logging from cinder.volume import driver LOG = logging.getLogger(__name__) diff --git a/cinder/volume/drivers/zfssa/restclient.py b/cinder/volume/drivers/zfssa/restclient.py index 667246954..19c29feab 100644 --- a/cinder/volume/drivers/zfssa/restclient.py +++ b/cinder/volume/drivers/zfssa/restclient.py @@ -21,8 +21,9 @@ import StringIO import time import urllib2 +from oslo_log import log + from cinder.i18n import _LE, _LI -from cinder.openstack.common import log LOG = log.getLogger(__name__) diff --git a/cinder/volume/drivers/zfssa/webdavclient.py b/cinder/volume/drivers/zfssa/webdavclient.py index 9ca5feae5..c100bf45b 100644 --- a/cinder/volume/drivers/zfssa/webdavclient.py +++ b/cinder/volume/drivers/zfssa/webdavclient.py @@ -19,9 +19,10 @@ import httplib import time import urllib2 +from oslo_log import log + from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log LOG = log.getLogger(__name__) diff --git a/cinder/volume/drivers/zfssa/zfssaiscsi.py b/cinder/volume/drivers/zfssa/zfssaiscsi.py index 7a5cf5584..508704301 100644 --- a/cinder/volume/drivers/zfssa/zfssaiscsi.py +++ b/cinder/volume/drivers/zfssa/zfssaiscsi.py @@ -18,11 +18,11 @@ import ast import base64 from oslo_config import cfg +from oslo_log import log from oslo_utils import units from cinder import exception from cinder.i18n import _, _LE, _LW -from cinder.openstack.common import log from cinder.volume import driver from cinder.volume.drivers.san import san from cinder.volume.drivers.zfssa import zfssarest diff --git a/cinder/volume/drivers/zfssa/zfssanfs.py b/cinder/volume/drivers/zfssa/zfssanfs.py index 36c28b27e..31d37f64d 100644 --- a/cinder/volume/drivers/zfssa/zfssanfs.py +++ b/cinder/volume/drivers/zfssa/zfssanfs.py @@ -19,12 +19,12 @@ import datetime as dt import errno from oslo_config import cfg +from oslo_log import log from oslo_utils import excutils from oslo_utils import units from cinder import exception from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log from cinder.volume.drivers import nfs from cinder.volume.drivers.san import san from cinder.volume.drivers.zfssa import zfssarest diff --git a/cinder/volume/drivers/zfssa/zfssarest.py b/cinder/volume/drivers/zfssa/zfssarest.py index 36190357e..f9ccf896a 100644 --- a/cinder/volume/drivers/zfssa/zfssarest.py +++ b/cinder/volume/drivers/zfssa/zfssarest.py @@ -16,9 +16,10 @@ ZFS Storage Appliance Proxy """ import json +from oslo_log import log + from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log from cinder.volume.drivers.zfssa import restclient from cinder.volume.drivers.zfssa import webdavclient diff --git a/cinder/volume/flows/api/create_volume.py b/cinder/volume/flows/api/create_volume.py index 0dc69e8d8..7d4900663 100644 --- a/cinder/volume/flows/api/create_volume.py +++ b/cinder/volume/flows/api/create_volume.py @@ -12,6 +12,7 @@ from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import timeutils from oslo_utils import units import taskflow.engines @@ -21,7 +22,6 @@ from taskflow.types import failure as ft from cinder import exception from cinder import flow_utils from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder import policy from cinder import quota from cinder import utils diff --git a/cinder/volume/flows/common.py b/cinder/volume/flows/common.py index d0e7e7733..a361de4e1 100644 --- a/cinder/volume/flows/common.py +++ b/cinder/volume/flows/common.py @@ -16,11 +16,11 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging import six from cinder import exception from cinder.i18n import _LE -from cinder.openstack.common import log as logging LOG = logging.getLogger(__name__) diff --git a/cinder/volume/flows/manager/create_volume.py b/cinder/volume/flows/manager/create_volume.py index d0cf043df..432a99310 100644 --- a/cinder/volume/flows/manager/create_volume.py +++ b/cinder/volume/flows/manager/create_volume.py @@ -14,6 +14,7 @@ import traceback from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import timeutils import taskflow.engines from taskflow.patterns import linear_flow @@ -24,7 +25,6 @@ from cinder import flow_utils from cinder.i18n import _, _LE, _LI from cinder.image import glance from cinder import objects -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.flows import common from cinder.volume import utils as volume_utils diff --git a/cinder/volume/flows/manager/manage_existing.py b/cinder/volume/flows/manager/manage_existing.py index ca39a1369..12f70e59f 100644 --- a/cinder/volume/flows/manager/manage_existing.py +++ b/cinder/volume/flows/manager/manage_existing.py @@ -12,13 +12,13 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging import taskflow.engines from taskflow.patterns import linear_flow from cinder import exception from cinder import flow_utils from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder.volume.flows.api import create_volume as create_api from cinder.volume.flows import common as flow_common from cinder.volume.flows.manager import create_volume as create_mgr diff --git a/cinder/volume/manager.py b/cinder/volume/manager.py index 28d59f32c..d3c4d713c 100644 --- a/cinder/volume/manager.py +++ b/cinder/volume/manager.py @@ -40,6 +40,7 @@ intact. import time from oslo_config import cfg +from oslo_log import log as logging import oslo_messaging as messaging from oslo_serialization import jsonutils from oslo_utils import excutils @@ -55,7 +56,6 @@ from cinder import flow_utils from cinder.i18n import _, _LE, _LI, _LW from cinder.image import glance from cinder import manager -from cinder.openstack.common import log as logging from cinder.openstack.common import periodic_task from cinder import quota from cinder import utils diff --git a/cinder/volume/qos_specs.py b/cinder/volume/qos_specs.py index eeca2a159..fbe4fc26d 100644 --- a/cinder/volume/qos_specs.py +++ b/cinder/volume/qos_specs.py @@ -18,12 +18,12 @@ from oslo_config import cfg from oslo_db import exception as db_exc +from oslo_log import log as logging from cinder import context from cinder import db from cinder import exception from cinder.i18n import _, _LE, _LW -from cinder.openstack.common import log as logging from cinder.volume import volume_types diff --git a/cinder/volume/targets/cxt.py b/cinder/volume/targets/cxt.py index 14bbf7446..c24e2495e 100644 --- a/cinder/volume/targets/cxt.py +++ b/cinder/volume/targets/cxt.py @@ -18,12 +18,12 @@ import os import re from oslo_concurrency import processutils as putils +from oslo_log import log as logging from oslo_utils import netutils from cinder import exception from cinder.openstack.common import fileutils from cinder.i18n import _LI, _LW, _LE -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.targets import iscsi diff --git a/cinder/volume/targets/iscsi.py b/cinder/volume/targets/iscsi.py index bdc099830..d965c57da 100644 --- a/cinder/volume/targets/iscsi.py +++ b/cinder/volume/targets/iscsi.py @@ -13,10 +13,10 @@ import abc from oslo_concurrency import processutils +from oslo_log import log as logging from cinder import exception from cinder.i18n import _, _LI, _LW, _LE -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.targets import driver from cinder.volume import utils as vutils diff --git a/cinder/volume/targets/iser.py b/cinder/volume/targets/iser.py index d35f337a6..bf13b7c57 100644 --- a/cinder/volume/targets/iser.py +++ b/cinder/volume/targets/iser.py @@ -10,9 +10,9 @@ # License for the specific language governing permissions and limitations # under the License. +from oslo_log import log as logging from cinder.i18n import _LW -from cinder.openstack.common import log as logging from cinder.volume.targets import tgt diff --git a/cinder/volume/targets/lio.py b/cinder/volume/targets/lio.py index 66388b446..a8f7276a2 100644 --- a/cinder/volume/targets/lio.py +++ b/cinder/volume/targets/lio.py @@ -11,10 +11,10 @@ # under the License. from oslo_concurrency import processutils as putils +from oslo_log import log as logging from cinder import exception from cinder.i18n import _LE, _LI, _LW -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.targets import iscsi diff --git a/cinder/volume/targets/scst.py b/cinder/volume/targets/scst.py index d96efad94..a262ad9aa 100644 --- a/cinder/volume/targets/scst.py +++ b/cinder/volume/targets/scst.py @@ -11,11 +11,11 @@ # under the License. from oslo_concurrency import processutils as putils +from oslo_log import log as logging from cinder import exception from cinder import utils from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder.volume.targets import iscsi from cinder.volume import utils as vutils diff --git a/cinder/volume/targets/tgt.py b/cinder/volume/targets/tgt.py index 9208c5a9b..2b29536d9 100644 --- a/cinder/volume/targets/tgt.py +++ b/cinder/volume/targets/tgt.py @@ -15,11 +15,11 @@ import re import time from oslo_concurrency import processutils as putils +from oslo_log import log as logging from cinder import exception from cinder.openstack.common import fileutils from cinder.i18n import _LI, _LW, _LE -from cinder.openstack.common import log as logging from cinder import utils from cinder.volume.targets import iscsi diff --git a/cinder/volume/throttling.py b/cinder/volume/throttling.py index 3d7aca979..ac50d94a4 100644 --- a/cinder/volume/throttling.py +++ b/cinder/volume/throttling.py @@ -19,10 +19,10 @@ import contextlib from oslo_concurrency import processutils +from oslo_log import log as logging from cinder import exception from cinder.i18n import _LW, _LE -from cinder.openstack.common import log as logging from cinder import utils diff --git a/cinder/volume/utils.py b/cinder/volume/utils.py index 5b4730b9d..d24211858 100644 --- a/cinder/volume/utils.py +++ b/cinder/volume/utils.py @@ -20,6 +20,7 @@ import math from Crypto.Random import random from oslo_concurrency import processutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import strutils from oslo_utils import timeutils from oslo_utils import units @@ -27,7 +28,6 @@ from oslo_utils import units from cinder.brick.local_dev import lvm as brick_lvm from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder import rpc from cinder import utils from cinder.volume import throttling diff --git a/cinder/volume/volume_types.py b/cinder/volume/volume_types.py index 207186d4c..1b3cbadb2 100644 --- a/cinder/volume/volume_types.py +++ b/cinder/volume/volume_types.py @@ -22,13 +22,13 @@ from oslo_config import cfg from oslo_db import exception as db_exc +from oslo_log import log as logging import six from cinder import context from cinder import db from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging CONF = cfg.CONF diff --git a/cinder/wsgi.py b/cinder/wsgi.py index 258b1d682..cf9287199 100644 --- a/cinder/wsgi.py +++ b/cinder/wsgi.py @@ -30,6 +30,8 @@ import eventlet import eventlet.wsgi import greenlet from oslo_config import cfg +from oslo_log import log as logging +from oslo_log import loggers from oslo_utils import excutils from oslo_utils import netutils from paste import deploy @@ -39,7 +41,6 @@ import webob.exc from cinder import exception from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder import utils @@ -128,7 +129,7 @@ class Server(object): self.pool_size = pool_size or self.default_pool_size self._pool = eventlet.GreenPool(self.pool_size) self._logger = logging.getLogger("eventlet.wsgi.server") - self._wsgi_logger = logging.WritableLogger(self._logger) + self._wsgi_logger = loggers.WritableLogger(self._logger) if backlog < 1: raise exception.InvalidInput( diff --git a/cinder/zonemanager/drivers/brocade/brcd_fabric_opts.py b/cinder/zonemanager/drivers/brocade/brcd_fabric_opts.py index 7e5fca238..ef70ecf9e 100644 --- a/cinder/zonemanager/drivers/brocade/brcd_fabric_opts.py +++ b/cinder/zonemanager/drivers/brocade/brcd_fabric_opts.py @@ -16,8 +16,8 @@ # under the License. # from oslo_config import cfg +from oslo_log import log as logging -from cinder.openstack.common import log as logging from cinder.volume import configuration brcd_zone_opts = [ diff --git a/cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py b/cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py index b91754b35..98cb8cc7c 100644 --- a/cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py +++ b/cinder/zonemanager/drivers/brocade/brcd_fc_san_lookup_service.py @@ -16,13 +16,12 @@ # under the License. # - +from oslo_log import log as logging from oslo_utils import excutils import paramiko from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder import utils from cinder.zonemanager.drivers.brocade import brcd_fabric_opts as fabric_opts import cinder.zonemanager.drivers.brocade.fc_zone_constants as zone_constant diff --git a/cinder/zonemanager/drivers/brocade/brcd_fc_zone_client_cli.py b/cinder/zonemanager/drivers/brocade/brcd_fc_zone_client_cli.py index 4bb53bcce..3eaa2728b 100644 --- a/cinder/zonemanager/drivers/brocade/brcd_fc_zone_client_cli.py +++ b/cinder/zonemanager/drivers/brocade/brcd_fc_zone_client_cli.py @@ -26,11 +26,11 @@ import re from eventlet import greenthread from oslo_concurrency import processutils +from oslo_log import log as logging from oslo_utils import excutils from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder import ssh_utils from cinder import utils import cinder.zonemanager.drivers.brocade.fc_zone_constants as ZoneConstant diff --git a/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py b/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py index 18ec645f7..f56e92aa7 100644 --- a/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py +++ b/cinder/zonemanager/drivers/brocade/brcd_fc_zone_driver.py @@ -32,12 +32,12 @@ add_connection and delete_connection interfaces. from oslo_concurrency import lockutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import importutils from cinder import exception from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder.zonemanager.drivers.brocade import brcd_fabric_opts as fabric_opts from cinder.zonemanager.drivers import fc_zone_driver diff --git a/cinder/zonemanager/drivers/cisco/cisco_fc_san_lookup_service.py b/cinder/zonemanager/drivers/cisco/cisco_fc_san_lookup_service.py index 3a169b671..ba77a7705 100644 --- a/cinder/zonemanager/drivers/cisco/cisco_fc_san_lookup_service.py +++ b/cinder/zonemanager/drivers/cisco/cisco_fc_san_lookup_service.py @@ -19,12 +19,12 @@ import random from eventlet import greenthread from oslo_concurrency import processutils +from oslo_log import log as logging from oslo_utils import excutils import six from cinder import exception from cinder.i18n import _, _LE -from cinder.openstack.common import log as logging from cinder import ssh_utils from cinder import utils from cinder.zonemanager.drivers.cisco import cisco_fabric_opts as fabric_opts diff --git a/cinder/zonemanager/drivers/cisco/cisco_fc_zone_client_cli.py b/cinder/zonemanager/drivers/cisco/cisco_fc_zone_client_cli.py index 9b102d94e..f71e99704 100644 --- a/cinder/zonemanager/drivers/cisco/cisco_fc_zone_client_cli.py +++ b/cinder/zonemanager/drivers/cisco/cisco_fc_zone_client_cli.py @@ -23,12 +23,12 @@ import re from eventlet import greenthread from oslo_concurrency import processutils +from oslo_log import log as logging from oslo_utils import excutils import six from cinder import exception from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder import ssh_utils from cinder import utils import cinder.zonemanager.drivers.cisco.fc_zone_constants as ZoneConstant diff --git a/cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py b/cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py index 1fccdfb67..2878ce3a5 100644 --- a/cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py +++ b/cinder/zonemanager/drivers/cisco/cisco_fc_zone_driver.py @@ -29,13 +29,13 @@ add_connection and delete_connection interfaces. from oslo_concurrency import lockutils from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import excutils from oslo_utils import importutils import six from cinder import exception from cinder.i18n import _, _LE, _LI -from cinder.openstack.common import log as logging from cinder.zonemanager.drivers.cisco import cisco_fabric_opts as fabric_opts from cinder.zonemanager.drivers import fc_zone_driver from cinder.zonemanager import utils as zm_utils diff --git a/cinder/zonemanager/drivers/fc_zone_driver.py b/cinder/zonemanager/drivers/fc_zone_driver.py index cf6196284..8bf7845f8 100644 --- a/cinder/zonemanager/drivers/fc_zone_driver.py +++ b/cinder/zonemanager/drivers/fc_zone_driver.py @@ -29,8 +29,8 @@ interfaces. """ +from oslo_log import log as logging -from cinder.openstack.common import log as logging from cinder.zonemanager import fc_common LOG = logging.getLogger(__name__) diff --git a/cinder/zonemanager/fc_san_lookup_service.py b/cinder/zonemanager/fc_san_lookup_service.py index f35c8576f..88e078079 100644 --- a/cinder/zonemanager/fc_san_lookup_service.py +++ b/cinder/zonemanager/fc_san_lookup_service.py @@ -23,11 +23,11 @@ defined in this class. """ +from oslo_log import log as logging from oslo_utils import importutils from cinder import exception from cinder.i18n import _ -from cinder.openstack.common import log as logging from cinder.volume import configuration as config from cinder.zonemanager import fc_common from cinder.zonemanager import fc_zone_manager diff --git a/cinder/zonemanager/fc_zone_manager.py b/cinder/zonemanager/fc_zone_manager.py index 5108135b8..cdc2d130e 100644 --- a/cinder/zonemanager/fc_zone_manager.py +++ b/cinder/zonemanager/fc_zone_manager.py @@ -32,11 +32,11 @@ detach operation. """ from oslo_config import cfg +from oslo_log import log as logging from oslo_utils import importutils from cinder import exception from cinder.i18n import _, _LI -from cinder.openstack.common import log as logging from cinder.volume import configuration as config from cinder.zonemanager import fc_common diff --git a/cinder/zonemanager/utils.py b/cinder/zonemanager/utils.py index c06703fee..c1f4d6b71 100644 --- a/cinder/zonemanager/utils.py +++ b/cinder/zonemanager/utils.py @@ -19,8 +19,9 @@ Utility functions related to the Zone Manager. """ import logging +from oslo_log import log + from cinder.i18n import _LI, _LW -from cinder.openstack.common import log from cinder.volume import configuration from cinder.volume import manager from cinder.zonemanager import fc_san_lookup_service diff --git a/openstack-common.conf b/openstack-common.conf index 9fe7951c1..8d149a40c 100644 --- a/openstack-common.conf +++ b/openstack-common.conf @@ -8,8 +8,6 @@ module=gettextutils module=imageutils module=install_venv_common module=local -module=log -module=log_handler module=loopingcall module=middleware module=periodic_task diff --git a/requirements.txt b/requirements.txt index 5f043ca5f..607349893 100644 --- a/requirements.txt +++ b/requirements.txt @@ -16,6 +16,7 @@ oslo.config>=1.6.0 # Apache-2.0 oslo.concurrency>=1.4.1 # Apache-2.0 oslo.context>=0.1.0 oslo.db>=1.4.1 # Apache-2.0 +oslo.log>=0.4.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