Remove unused logging import and LOG global var

In some modules the global LOG is not used any more. And the import
of logging is not used. This patch removes the unused logging import
and LOG vars.

Co-Authored-By: ChangBo Guo(gcb) <eric.guo@easystack.cn>
Change-Id: Ia72f99688ce00aeecca9239f9ef123611259a2fa
This commit is contained in:
Zhihai Song 2015-12-25 18:28:45 +08:00 committed by ChangBo Guo(gcb)
parent 94f1fe1e46
commit e33d6bfb0b
42 changed files with 6 additions and 154 deletions

View File

@ -13,7 +13,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_log import log as logging
import oslo_messaging
from cinder.api import extensions
@ -25,9 +24,6 @@ from cinder import objects
from cinder.volume import rpcapi
LOG = logging.getLogger(__name__)
def authorize(context, action_name):
extensions.extension_authorizer('volume', action_name)(context)

View File

@ -14,13 +14,10 @@
"""The Extended Snapshot Attributes API extension."""
from oslo_log import log as logging
from cinder.api import extensions
from cinder.api.openstack import wsgi
LOG = logging.getLogger(__name__)
authorize = extensions.soft_extension_authorizer(
'volume',
'extended_snapshot_attributes')

View File

@ -12,15 +12,12 @@
# 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.i18n import _
LOG = logging.getLogger(__name__)
class SchedulerHintsController(wsgi.Controller):

View File

@ -14,17 +14,12 @@
"""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.scheduler import rpcapi
LOG = logging.getLogger(__name__)
def authorize(context, action_name):
action = 'scheduler_stats:%s' % action_name
extensions.extension_authorizer('scheduler', action)(context)

View File

@ -14,7 +14,6 @@
from oslo_config import cfg
from oslo_log import log as logging
import oslo_messaging as messaging
from oslo_utils import encodeutils
from oslo_utils import strutils
@ -30,7 +29,6 @@ from cinder import utils
from cinder import volume
LOG = logging.getLogger(__name__)
CONF = cfg.CONF

View File

@ -12,13 +12,10 @@
# 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
LOG = logging.getLogger(__name__)
authorize = extensions.soft_extension_authorizer('volume',
'volume_host_attribute')

View File

@ -15,7 +15,6 @@
import re
from oslo_log import log as logging
import paste.urlmap
try:
from urllib.request import parse_http_list # pylint: disable=E0611
@ -31,8 +30,6 @@ _option_header_piece_re = re.compile(
r'(?:=\s*([^;]+|%s))?\s*' %
(_quoted_string_re, _quoted_string_re))
LOG = logging.getLogger(__name__)
def unquote_header_value(value):
"""Unquotes a header value.

View File

@ -19,8 +19,6 @@
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
@ -32,9 +30,6 @@ from cinder.api.v1 import volumes
from cinder.api import versions
LOG = logging.getLogger(__name__)
class APIRouter(cinder.api.openstack.APIRouter):
"""Routes requests on the API to the appropriate controller and method."""
ExtensionManager = extensions.ExtensionManager

View File

@ -19,8 +19,6 @@
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
@ -32,9 +30,6 @@ from cinder.api.v2 import volumes
from cinder.api import versions
LOG = logging.getLogger(__name__)
class APIRouter(cinder.api.openstack.APIRouter):
"""Routes requests on the API to the appropriate controller and method."""
ExtensionManager = extensions.ExtensionManager

View File

@ -13,15 +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.api import common
LOG = logging.getLogger(__name__)
class ViewBuilder(common.ViewBuilder):
"""Model a server API response as a python dictionary."""

View File

@ -19,8 +19,6 @@
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
@ -33,9 +31,6 @@ from cinder.api.v3 import volumes
from cinder.api import versions
LOG = logging.getLogger(__name__)
class APIRouter(cinder.api.openstack.APIRouter):
"""Routes requests on the API to the appropriate controller and method."""
ExtensionManager = extensions.ExtensionManager

View File

@ -13,14 +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
LOG = logging.getLogger(__name__)
class ViewBuilder(common.ViewBuilder):
"""Model backup API responses as a python dictionary."""

View File

@ -13,14 +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
LOG = logging.getLogger(__name__)
class ViewBuilder(common.ViewBuilder):
"""Model cgsnapshot API responses as a python dictionary."""

View File

@ -13,14 +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
LOG = logging.getLogger(__name__)
class ViewBuilder(common.ViewBuilder):
"""Model consistencygroup API responses as a python dictionary."""

View File

@ -13,14 +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
LOG = logging.getLogger(__name__)
class ViewBuilder(common.ViewBuilder):
"""Model QoS specs API responses as a python dictionary."""

View File

@ -13,14 +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
LOG = logging.getLogger(__name__)
class ViewBuilder(common.ViewBuilder):
"""Model snapshot API responses as a python dictionary."""

View File

@ -13,14 +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
LOG = logging.getLogger(__name__)
class ViewBuilder(common.ViewBuilder):
"""Model transfer API responses as a python dictionary."""

View File

@ -13,7 +13,6 @@
# under the License.
from oslo_config import cfg
from oslo_log import log as logging
from oslo_serialization import base64
from oslo_serialization import jsonutils
from oslo_utils import versionutils
@ -26,8 +25,8 @@ from cinder import objects
from cinder.objects import base
from cinder.objects import fields as c_fields
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
@base.CinderObjectRegistry.register

View File

@ -12,7 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_log import log as logging
from oslo_utils import versionutils
from oslo_versionedobjects import fields
@ -23,8 +22,6 @@ from cinder import objects
from cinder.objects import base
from cinder.objects import fields as c_fields
LOG = logging.getLogger(__name__)
@base.CinderObjectRegistry.register
class Service(base.CinderPersistentObject, base.CinderObject,

View File

@ -13,7 +13,6 @@
# under the License.
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import versionutils
from oslo_versionedobjects import fields
@ -23,8 +22,9 @@ from cinder.i18n import _
from cinder import objects
from cinder.objects import base
from cinder.objects import fields as c_fields
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
@base.CinderObjectRegistry.register

View File

@ -13,7 +13,6 @@
# under the License.
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import versionutils
from oslo_versionedobjects import fields
@ -23,8 +22,8 @@ from cinder.i18n import _
from cinder import objects
from cinder.objects import base
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
class MetadataObject(dict):

View File

@ -12,15 +12,12 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_log import log as logging
from oslo_versionedobjects import fields
from cinder import db
from cinder import objects
from cinder.objects import base
LOG = logging.getLogger(__name__)
@base.CinderObjectRegistry.register
class VolumeAttachment(base.CinderPersistentObject, base.CinderObject,

View File

@ -12,7 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
from oslo_log import log as logging
from oslo_versionedobjects import fields
from cinder import exception
@ -21,8 +20,8 @@ from cinder import objects
from cinder.objects import base
from cinder.volume import volume_types
OPTIONAL_FIELDS = ['extra_specs', 'projects']
LOG = logging.getLogger(__name__)
@base.CinderObjectRegistry.register

View File

@ -17,8 +17,6 @@ Handles all requests relating to volume replication.
"""
import functools
from oslo_log import log as logging
from cinder.db import base
from cinder import exception
from cinder.i18n import _
@ -28,8 +26,6 @@ from cinder.volume import rpcapi as volume_rpcapi
from cinder.volume import utils as volume_utils
LOG = logging.getLogger(__name__)
PROMOTE_PROCEED_STATUS = ('active', 'active-stopped')
REENABLE_PROCEED_STATUS = ('inactive', 'active-stopped', 'error')

View File

@ -14,14 +14,11 @@
# 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.scheduler import filters
from cinder.volume import api as volume
LOG = logging.getLogger(__name__)
class AffinityFilter(filters.BaseHostFilter):
def __init__(self):

View File

@ -23,15 +23,11 @@ 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.scheduler import weights
LOG = logging.getLogger(__name__)
volume_number_weight_opts = [
cfg.FloatOpt('volume_number_multiplier',
default=-1.0,

View File

@ -33,7 +33,6 @@ from oslo_concurrency import lockutils
from oslo_config import cfg
from oslo_config import fixture as config_fixture
from oslo_log.fixture import logging_error as log_fixture
from oslo_log import log
from oslo_messaging import conffixture as messaging_conffixture
from oslo_utils import strutils
from oslo_utils import timeutils
@ -54,8 +53,6 @@ from cinder.tests.unit import fake_notifier
CONF = cfg.CONF
LOG = log.getLogger(__name__)
_DB_CACHE = None

View File

@ -16,8 +16,6 @@ import copy
import mock
import six
from oslo_log import log as logging
from cinder.db.sqlalchemy import models
from cinder import exception
from cinder import objects
@ -28,9 +26,6 @@ from cinder.tests.unit import fake_volume
from cinder.tests.unit import objects as test_objects
LOG = logging.getLogger(__name__)
fake_db_snapshot = fake_snapshot.fake_db_snapshot(
cgsnapshot_id=fake.CGSNAPSHOT_ID)
del fake_db_snapshot['metadata']

View File

@ -22,8 +22,6 @@ import tempfile
import time
from xml.dom import minidom
from oslo_log import log as logging
from cinder import exception
from cinder import test
from cinder.tests.unit import utils
@ -38,7 +36,6 @@ from cinder.volume.drivers.huawei import replication
from cinder.volume.drivers.huawei import rest_client
from cinder.volume.drivers.huawei import smartx
LOG = logging.getLogger(__name__)
hypermetro_devices = """{
"remote_device": {

View File

@ -14,7 +14,6 @@
# under the License.
import mock
from oslo_log import log as logging
from cinder import context
from cinder import exception
@ -24,7 +23,6 @@ from cinder.volume.drivers import xio
from cinder.volume import qos_specs
from cinder.volume import volume_types
LOG = logging.getLogger("cinder.volume.driver")
ISE_IP1 = '10.12.12.1'
ISE_IP2 = '10.11.12.2'

View File

@ -40,11 +40,9 @@ and registered in the group in which they are used.
from oslo_config import cfg
from oslo_log import log as logging
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
class Configuration(object):

View File

@ -14,15 +14,11 @@
# under the License.
#
from oslo_log import log as logging
import cinder.volume.driver
from cinder.volume.drivers.dothill import dothill_common
from cinder.volume.drivers.san import san
from cinder.zonemanager import utils as fczm_utils
LOG = logging.getLogger(__name__)
class DotHillFCDriver(cinder.volume.driver.FibreChannelDriver):
"""OpenStack Fibre Channel cinder drivers for DotHill Arrays.

View File

@ -21,6 +21,7 @@ from cinder import exception
from cinder.i18n import _
from cinder.volume.drivers.huawei import constants
LOG = logging.getLogger(__name__)

View File

@ -16,16 +16,11 @@
Volume driver for NetApp Data ONTAP (7-mode) FibreChannel storage systems.
"""
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
LOG = logging.getLogger(__name__)
class NetApp7modeFibreChannelDriver(driver.BaseVD,
driver.ConsistencyGroupVD,
driver.ManageableVD,

View File

@ -16,16 +16,11 @@
Volume driver for NetApp Data ONTAP (C-mode) FibreChannel storage systems.
"""
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
LOG = logging.getLogger(__name__)
class NetAppCmodeFibreChannelDriver(driver.BaseVD,
driver.ConsistencyGroupVD,
driver.ManageableVD,

View File

@ -16,15 +16,10 @@
Volume driver for NetApp Data ONTAP (7-mode) iSCSI storage systems.
"""
from oslo_log import log as logging
from cinder.volume import driver
from cinder.volume.drivers.netapp.dataontap import block_7mode
LOG = logging.getLogger(__name__)
class NetApp7modeISCSIDriver(driver.BaseVD,
driver.ConsistencyGroupVD,
driver.ManageableVD,

View File

@ -16,15 +16,10 @@
Volume driver for NetApp Data ONTAP (C-mode) iSCSI storage systems.
"""
from oslo_log import log as logging
from cinder.volume import driver
from cinder.volume.drivers.netapp.dataontap import block_cmode
LOG = logging.getLogger(__name__)
class NetAppCmodeISCSIDriver(driver.BaseVD,
driver.ConsistencyGroupVD,
driver.ManageableVD,

View File

@ -16,15 +16,11 @@
Volume driver for NetApp E-Series FibreChannel storage systems.
"""
from oslo_log import log as logging
from cinder.volume import driver
from cinder.volume.drivers.netapp.eseries import library
from cinder.volume.drivers.netapp import utils as na_utils
from cinder.zonemanager import utils as fczm_utils
LOG = logging.getLogger(__name__)
class NetAppEseriesFibreChannelDriver(driver.BaseVD,
driver.ManageableVD,

View File

@ -18,16 +18,11 @@
Volume driver for NetApp E-Series iSCSI storage systems.
"""
from oslo_log import log as logging
from cinder.volume import driver
from cinder.volume.drivers.netapp.eseries import library
from cinder.volume.drivers.netapp import utils as na_utils
LOG = logging.getLogger(__name__)
class NetAppEseriesISCSIDriver(driver.BaseVD,
driver.ManageableVD,
driver.ExtendVD,

View File

@ -20,12 +20,9 @@ import base64
import binascii
import uuid
from oslo_log import log as logging
import six
LOG = logging.getLogger(__name__)
MULTI_ATTACH_HOST_GROUP_NAME = 'cinder-multi-attach'
NULL_REF = '0000000000000000000000000000000000000000'
MAX_LUNS_PER_HOST = 256

View File

@ -14,14 +14,11 @@
"""Utility methods for working with WSGI servers."""
from oslo_log import log as logging
import webob.dec
import webob.exc
from cinder.i18n import _
LOG = logging.getLogger(__name__)
class Request(webob.Request):
pass

View File

@ -17,7 +17,6 @@ from __future__ import print_function
import socket
from oslo_config import cfg
from oslo_log import log as logging
from oslo_service import wsgi
from oslo_utils import netutils
@ -39,8 +38,6 @@ socket_opts = [
CONF = cfg.CONF
CONF.register_opts(socket_opts)
LOG = logging.getLogger(__name__)
class Server(wsgi.Server):
"""Server class to manage a WSGI server, serving a WSGI application."""