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.

Change-Id: I28572c325f8c31ff38161010047bba00c5d5b833
This commit is contained in:
Zhihai Song 2015-12-25 17:50:01 +08:00
parent 727656d2f5
commit f396c8e5fa
23 changed files with 0 additions and 73 deletions

View File

@ -16,7 +16,6 @@
"""The bare-metal admin extension with Ironic Proxy."""
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import importutils
import webob
@ -55,8 +54,6 @@ CONF.import_opt('admin_tenant_name',
group='ironic')
CONF.import_opt('compute_driver', 'nova.virt.driver')
LOG = logging.getLogger(__name__)
def _check_ironic_client_enabled():
"""Check whether Ironic is installed or not."""

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 nova.api.openstack import extensions
from nova.api.openstack import wsgi
from nova import compute
LOG = logging.getLogger(__name__)
authorize = extensions.soft_extension_authorizer('compute', 'server_usage')

View File

@ -17,13 +17,9 @@
Cell scheduler filters
"""
from oslo_log import log as logging
from nova import filters
from nova import policy
LOG = logging.getLogger(__name__)
class BaseCellFilter(filters.BaseFilter):
"""Base class for cell filters."""

View File

@ -27,12 +27,8 @@ cells.
from distutils import versionpredicate
from oslo_log import log as logging
from nova.cells import filters
LOG = logging.getLogger(__name__)
class ImagePropertiesFilter(filters.BaseCellFilter):
"""Image properties filter. Works by specifying the hypervisor required in

View File

@ -52,7 +52,6 @@ This module provides Manager, a base class for managers.
"""
from oslo_config import cfg
from oslo_log import log as logging
from oslo_service import periodic_task
from nova.db import base
@ -61,7 +60,6 @@ from nova import rpc
CONF = cfg.CONF
CONF.import_opt('host', 'nova.netconf')
LOG = logging.getLogger(__name__)
class PeriodicTasks(periodic_task.PeriodicTasks):

View File

@ -20,7 +20,6 @@ import functools
import traceback
import netaddr
from oslo_log import log as logging
import oslo_messaging as messaging
from oslo_utils import versionutils
from oslo_versionedobjects import base as ovoo_base
@ -33,9 +32,6 @@ from nova.objects import fields as obj_fields
from nova import utils
LOG = logging.getLogger('object')
def get_attrname(name):
"""Return the mangled name of the attribute's underlying storage."""
# FIXME(danms): This is just until we use o.vo's class properties

View File

@ -15,7 +15,6 @@
import copy
from oslo_log import log as logging
from oslo_serialization import jsonutils
from oslo_utils import versionutils
@ -26,9 +25,6 @@ from nova.objects import base
from nova.objects import fields
LOG = logging.getLogger(__name__)
def compare_pci_device_attributes(obj_a, obj_b):
pci_ignore_fields = base.NovaPersistentObject.fields.keys()
for name in obj_a.obj_fields:

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_serialization import jsonutils
import six
@ -25,8 +24,6 @@ from nova.objects import fields
from nova.objects import instance as obj_instance
from nova.virt import hardware
LOG = logging.getLogger(__name__)
@base.NovaObjectRegistry.register
class RequestSpec(base.NovaObject):

View File

@ -40,7 +40,6 @@ import copy
import jsonschema
from oslo_config import cfg
from oslo_log import log as logging
from oslo_serialization import jsonutils
import six
@ -71,8 +70,6 @@ PCI_NET_TAG = 'physical_network'
CONF = cfg.CONF
CONF.register_opts(pci_alias_opts)
LOG = logging.getLogger(__name__)
_ALIAS_DEV_TYPE = ['NIC', 'ACCEL', 'GPU']
_ALIAS_CAP_TYPE = ['pci']

View File

@ -15,7 +15,6 @@
# under the License.
from oslo_config import cfg
from oslo_log import log as logging
from oslo_serialization import jsonutils
from nova import exception
@ -32,8 +31,6 @@ pci_opts = [cfg.MultiStrOpt('pci_passthrough_whitelist',
CONF = cfg.CONF
CONF.register_opts(pci_opts)
LOG = logging.getLogger(__name__)
class Whitelist(object):

View File

@ -21,16 +21,12 @@ This host manager will consume all cpu's, disk space, and
ram from a host / node as it is supporting Baremetal hosts, which can not be
subdivided into multiple instances.
"""
from oslo_log import log as logging
from nova.compute import hv_type
import nova.conf
from nova.scheduler import host_manager
CONF = nova.conf.CONF
LOG = logging.getLogger(__name__)
class IronicNodeState(host_manager.HostState):
"""Mutable and immutable information tracked for a host.

View File

@ -19,7 +19,6 @@
Scheduler Service
"""
from oslo_log import log as logging
import oslo_messaging as messaging
from oslo_serialization import jsonutils
from oslo_service import periodic_task
@ -31,8 +30,6 @@ from nova import manager
from nova import quota
LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
QUOTAS = quota.QUOTAS

View File

@ -48,7 +48,6 @@ from nova import test
CONF = cfg.CONF
LOG = logging.getLogger(__name__)
class NovaAPIModelsSync(test_migrations.ModelsMigrationsSync):

View File

@ -60,9 +60,6 @@ from nova import test
from nova.tests import fixtures as nova_fixtures
LOG = logging.getLogger(__name__)
class NovaMigrationsCheckers(test_migrations.ModelsMigrationsSync,
test_migrations.WalkVersionsMixin):
"""Test sqlalchemy-migrate migrations."""

View File

@ -23,7 +23,6 @@ from mox3 import mox
import netifaces
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 fileutils
from oslo_utils import timeutils
@ -37,7 +36,6 @@ from nova import objects
from nova import test
from nova import utils
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
CONF.import_opt('share_dhcp_address', 'nova.objects.network')
CONF.import_opt('network_device_mtu', 'nova.objects.network')

View File

@ -12,7 +12,6 @@
import mock
from oslo_log import log as logging
from nova import exception
from nova import objects
@ -21,9 +20,6 @@ from nova import utils
from nova.virt.libvirt.storage import rbd_utils
LOG = logging.getLogger(__name__)
CEPH_MON_DUMP = """dumped monmap epoch 1
{ "epoch": 1,
"fsid": "33630410-6d93-4d66-8e42-3b953cf194aa",

View File

@ -19,7 +19,6 @@ import os
import shutil
from oslo_config import cfg
from oslo_log import log as logging
from oslo_utils import fileutils
from oslo_utils import units
@ -29,8 +28,6 @@ from nova.objects import fields
from nova import utils
from nova import version
LOG = logging.getLogger(__name__)
configdrive_opts = [
cfg.StrOpt('config_drive_format',
default='iso9660',

View File

@ -13,12 +13,8 @@
# under the License.
"""Support for mounting block device based images directly."""
from oslo_log import log as logging
from nova.virt.disk.mount import api
LOG = logging.getLogger(__name__)
class BlockMount(api.Mount):
"""Block device backed images do not need to be linked because

View File

@ -17,14 +17,11 @@ import os
from os_win.utils import pathutils
from oslo_config import cfg
from oslo_log import log as logging
from nova import exception
from nova.i18n import _
from nova.virt.hyperv import constants
LOG = logging.getLogger(__name__)
hyperv_opts = [
cfg.StrOpt('instances_path_share',
default="",

View File

@ -18,7 +18,6 @@ import abc
from os_win import utilsfactory
from oslo_config import cfg
from oslo_log import log as logging
hyperv_opts = [
cfg.StrOpt('vswitch_name',
@ -30,8 +29,6 @@ hyperv_opts = [
CONF = cfg.CONF
CONF.register_opts(hyperv_opts, 'hyperv')
LOG = logging.getLogger(__name__)
class HyperVBaseVIFDriver(object):
@abc.abstractmethod

View File

@ -15,14 +15,10 @@
import abc
from oslo_log import log as logging
import six
from nova import keymgr
LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class VolumeEncryptor(object):

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 nova.volume.encryptors import base
LOG = logging.getLogger(__name__)
class NoOpEncryptor(base.VolumeEncryptor):
"""A VolumeEncryptor that does nothing.

View File

@ -30,7 +30,6 @@ CONF = cfg.CONF
config_files = ['/etc/nova/api-paste.ini', '/etc/nova/nova.conf']
config.parse_args([], default_config_files=config_files)
LOG = logging.getLogger(__name__)
logging.setup(CONF, "nova")
utils.monkey_patch()
objects.register_all()