From f51f387b8cb8058a8f5a0c486c256a7a4d79b37d Mon Sep 17 00:00:00 2001 From: Zhongyue Luo Date: Mon, 21 May 2012 15:55:52 +0800 Subject: [PATCH] Cleanup LOG.getLoggers to use __name__ Fixes bug #1002191 Change-Id: I166c6bf535ac097e3e6f64158bde0c7f5448a7b3 --- .../openstack/compute/contrib/extended_server_attributes.py | 3 +-- nova/network/quantum/sg.py | 2 +- nova/tests/api/ec2/test_ec2_validate.py | 2 +- nova/tests/test_migrations.py | 2 +- nova/tests/test_netapp.py | 2 +- nova/virt/xenapi/pool.py | 2 +- nova/volume/netapp.py | 2 +- nova/volume/nexenta/jsonrpc.py | 2 +- nova/volume/nexenta/volume.py | 2 +- 9 files changed, 9 insertions(+), 10 deletions(-) diff --git a/nova/api/openstack/compute/contrib/extended_server_attributes.py b/nova/api/openstack/compute/contrib/extended_server_attributes.py index 9b7d5f6dbb8c..2da5badc34e3 100644 --- a/nova/api/openstack/compute/contrib/extended_server_attributes.py +++ b/nova/api/openstack/compute/contrib/extended_server_attributes.py @@ -27,8 +27,7 @@ from nova import log as logging FLAGS = flags.FLAGS -LOG = logging.getLogger("nova.api.openstack.compute.contrib." - "extended_server_attributes") +LOG = logging.getLogger(__name__) authorize = extensions.soft_extension_authorizer('compute', 'extended_server_attributes') diff --git a/nova/network/quantum/sg.py b/nova/network/quantum/sg.py index 93ba6be11978..7212280c53e0 100644 --- a/nova/network/quantum/sg.py +++ b/nova/network/quantum/sg.py @@ -30,7 +30,7 @@ security_group_handler flag. from nova import log as logging -LOG = logging.getLogger('nova.network.api.quantum.sg') +LOG = logging.getLogger(__name__) class SecurityGroupHandlerBase(object): diff --git a/nova/tests/api/ec2/test_ec2_validate.py b/nova/tests/api/ec2/test_ec2_validate.py index ae494ccde8c4..5def89175496 100644 --- a/nova/tests/api/ec2/test_ec2_validate.py +++ b/nova/tests/api/ec2/test_ec2_validate.py @@ -34,7 +34,7 @@ from nova.openstack.common import importutils from nova import rpc from nova import test -LOG = logging.getLogger('nova.tests.ec2_validate') +LOG = logging.getLogger(__name__) FLAGS = flags.FLAGS diff --git a/nova/tests/test_migrations.py b/nova/tests/test_migrations.py index 559a06fafe9f..5467418c49f4 100644 --- a/nova/tests/test_migrations.py +++ b/nova/tests/test_migrations.py @@ -38,7 +38,7 @@ from nova.db.sqlalchemy.migration import versioning_api as migration_api from nova import log as logging from nova import test -LOG = logging.getLogger('nova.tests.test_migrations') +LOG = logging.getLogger(__name__) def _mysql_get_connect_string(user="openstack_citest", diff --git a/nova/tests/test_netapp.py b/nova/tests/test_netapp.py index 579227c7879d..0688a659639e 100644 --- a/nova/tests/test_netapp.py +++ b/nova/tests/test_netapp.py @@ -29,7 +29,7 @@ from nova import log as logging from nova import test from nova.volume import netapp -LOG = logging.getLogger("nova.volume.driver") +LOG = logging.getLogger(__name__) WSDL_HEADER = """ diff --git a/nova/virt/xenapi/pool.py b/nova/virt/xenapi/pool.py index 4609b7effba6..f3cce22a9d9b 100644 --- a/nova/virt/xenapi/pool.py +++ b/nova/virt/xenapi/pool.py @@ -31,7 +31,7 @@ from nova.openstack.common import cfg from nova import rpc from nova.virt.xenapi import vm_utils -LOG = logging.getLogger("nova.virt.xenapi.pool") +LOG = logging.getLogger(__name__) xenapi_pool_opts = [ cfg.BoolOpt('use_join_force', diff --git a/nova/volume/netapp.py b/nova/volume/netapp.py index 711d8a140314..897da62040c3 100644 --- a/nova/volume/netapp.py +++ b/nova/volume/netapp.py @@ -36,7 +36,7 @@ from nova import log as logging from nova.openstack.common import cfg from nova.volume import driver -LOG = logging.getLogger("nova.volume.driver") +LOG = logging.getLogger(__name__) netapp_opts = [ cfg.StrOpt('netapp_wsdl_url', diff --git a/nova/volume/nexenta/jsonrpc.py b/nova/volume/nexenta/jsonrpc.py index 03921bfdbbf1..ced29888baa0 100644 --- a/nova/volume/nexenta/jsonrpc.py +++ b/nova/volume/nexenta/jsonrpc.py @@ -28,7 +28,7 @@ import urllib2 from nova import log as logging from nova.volume import nexenta -LOG = logging.getLogger("nova.volume.nexenta.jsonrpc") +LOG = logging.getLogger(__name__) class NexentaJSONException(nexenta.NexentaException): diff --git a/nova/volume/nexenta/volume.py b/nova/volume/nexenta/volume.py index 532698ba7c95..784d48d4feeb 100644 --- a/nova/volume/nexenta/volume.py +++ b/nova/volume/nexenta/volume.py @@ -30,7 +30,7 @@ from nova.volume import driver from nova.volume import nexenta from nova.volume.nexenta import jsonrpc -LOG = logging.getLogger("nova.volume.nexenta.volume") +LOG = logging.getLogger(__name__) FLAGS = flags.FLAGS nexenta_opts = [