Standardize logging delaration and use
* Make modules use getLogger(__name__) and log to the result Change-Id: Ib6d69b4be140ec89affc86ed11e65e422d551df1
This commit is contained in:
@@ -90,7 +90,7 @@ ldap_opts = [
|
|||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
FLAGS.register_opts(ldap_opts)
|
FLAGS.register_opts(ldap_opts)
|
||||||
|
|
||||||
LOG = logging.getLogger("nova.ldapdriver")
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
if FLAGS.memcached_servers:
|
if FLAGS.memcached_servers:
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ FLAGS.register_opts(auth_opts)
|
|||||||
|
|
||||||
flags.DECLARE('osapi_compute_listen_port', 'nova.service')
|
flags.DECLARE('osapi_compute_listen_port', 'nova.service')
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.auth.manager')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
if FLAGS.memcached_servers:
|
if FLAGS.memcached_servers:
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ from nova import exception
|
|||||||
from nova import log as logging
|
from nova import log as logging
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.signer')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class Signer(object):
|
class Signer(object):
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ from nova import log as logging
|
|||||||
from nova.openstack.common import cfg
|
from nova.openstack.common import cfg
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.exception')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
notifier_opts = [
|
notifier_opts = [
|
||||||
cfg.StrOpt('default_notification_level',
|
cfg.StrOpt('default_notification_level',
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ from nova import db
|
|||||||
from nova import log as logging
|
from nova import log as logging
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.notifier.capacity_notifier')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def notify(message):
|
def notify(message):
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ list_notifier_drivers_opt = cfg.MultiStrOpt('list_notifier_drivers',
|
|||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
FLAGS.register_opt(list_notifier_drivers_opt)
|
FLAGS.register_opt(list_notifier_drivers_opt)
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.notifier.list_notifier')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
drivers = None
|
drivers = None
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ from nova import log as logging
|
|||||||
from nova.openstack.common import cfg
|
from nova.openstack.common import cfg
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.rpc')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
rpc_opts = [
|
rpc_opts = [
|
||||||
cfg.IntOpt('rpc_thread_pool_size',
|
cfg.IntOpt('rpc_thread_pool_size',
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ enable_zone_routing_opt = cfg.BoolOpt('enable_zone_routing',
|
|||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
FLAGS.register_opt(enable_zone_routing_opt)
|
FLAGS.register_opt(enable_zone_routing_opt)
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.scheduler.api')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def _call_scheduler(method, context, params=None):
|
def _call_scheduler(method, context, params=None):
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ from nova import utils
|
|||||||
|
|
||||||
|
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
LOG = logging.getLogger('nova.scheduler.distributed_scheduler')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class DistributedScheduler(driver.Scheduler):
|
class DistributedScheduler(driver.Scheduler):
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ from nova.openstack.common import cfg
|
|||||||
from nova import log as logging
|
from nova import log as logging
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.scheduler.least_cost')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
least_cost_opts = [
|
least_cost_opts = [
|
||||||
cfg.ListOpt('least_cost_functions',
|
cfg.ListOpt('least_cost_functions',
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ from nova.vsa.api import VsaState
|
|||||||
from nova.volume import volume_types
|
from nova.volume import volume_types
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.scheduler.vsa')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
vsa_scheduler_opts = [
|
vsa_scheduler_opts = [
|
||||||
cfg.IntOpt('drive_type_approx_capacity_percent',
|
cfg.IntOpt('drive_type_approx_capacity_percent',
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ zone_manager_opts = [
|
|||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
FLAGS.register_opts(zone_manager_opts)
|
FLAGS.register_opts(zone_manager_opts)
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.scheduler.zone_manager')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class ZoneState(object):
|
class ZoneState(object):
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ from eventlet import greenthread
|
|||||||
from nova import log as logging
|
from nova import log as logging
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger("nova.testing.fake.rabbit")
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
EXCHANGES = {}
|
EXCHANGES = {}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ from nova.rpc.common import RemoteError, Timeout
|
|||||||
from nova import test
|
from nova import test
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.rpc')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class _BaseRpcTestCase(test.TestCase):
|
class _BaseRpcTestCase(test.TestCase):
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ from nova.rpc import impl_carrot
|
|||||||
from nova.tests.rpc import common
|
from nova.tests.rpc import common
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.rpc')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class RpcCarrotTestCase(common._BaseRpcTestCase):
|
class RpcCarrotTestCase(common._BaseRpcTestCase):
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ from nova.rpc import impl_fake
|
|||||||
from nova.tests.rpc import common
|
from nova.tests.rpc import common
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.rpc')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class RpcFakeTestCase(common._BaseRpcTestCase):
|
class RpcFakeTestCase(common._BaseRpcTestCase):
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ from nova.rpc import impl_kombu
|
|||||||
from nova.tests.rpc import common
|
from nova.tests.rpc import common
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.rpc')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class MyException(Exception):
|
class MyException(Exception):
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ except ImportError:
|
|||||||
impl_qpid = None
|
impl_qpid = None
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.rpc')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class RpcQpidTestCase(test.TestCase):
|
class RpcQpidTestCase(test.TestCase):
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ from nova.volume import volume_types
|
|||||||
|
|
||||||
|
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
LOG = logging.getLogger('nova.tests.scheduler.vsa')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
scheduled_volumes = []
|
scheduled_volumes = []
|
||||||
scheduled_volume = {}
|
scheduled_volume = {}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ from nova import log as logging
|
|||||||
from nova.volume.san import SolidFireSanISCSIDriver as SFID
|
from nova.volume.san import SolidFireSanISCSIDriver as SFID
|
||||||
from nova import test
|
from nova import test
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.test_solidfire')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class SolidFireVolumeTestCase(test.TestCase):
|
class SolidFireVolumeTestCase(test.TestCase):
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ from nova.api.ec2 import cloud
|
|||||||
from nova.auth import fakeldap
|
from nova.auth import fakeldap
|
||||||
|
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
LOG = logging.getLogger('nova.tests.auth_unittest')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class user_generator(object):
|
class user_generator(object):
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ from nova import utils
|
|||||||
import nova.volume
|
import nova.volume
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.compute')
|
LOG = logging.getLogger(__name__)
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
flags.DECLARE('stub_network', 'nova.compute.manager')
|
flags.DECLARE('stub_network', 'nova.compute.manager')
|
||||||
flags.DECLARE('live_migration_retry_count', 'nova.compute.manager')
|
flags.DECLARE('live_migration_retry_count', 'nova.compute.manager')
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ from nova.notifier import test_notifier
|
|||||||
from nova.tests import fake_network
|
from nova.tests import fake_network
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.compute_utils')
|
LOG = logging.getLogger(__name__)
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
flags.DECLARE('stub_network', 'nova.compute.manager')
|
flags.DECLARE('stub_network', 'nova.compute.manager')
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ from nova.consoleauth import manager
|
|||||||
|
|
||||||
|
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
LOG = logging.getLogger('nova.tests.consoleauth')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class ConsoleauthTestCase(test.TestCase):
|
class ConsoleauthTestCase(test.TestCase):
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ from nova.virt.libvirt import utils as virtutils
|
|||||||
flags.DECLARE('instances_path', 'nova.compute.manager')
|
flags.DECLARE('instances_path', 'nova.compute.manager')
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.test_imagecache')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class ImageCacheManagerTestCase(test.TestCase):
|
class ImageCacheManagerTestCase(test.TestCase):
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ from nova.db.sqlalchemy.session import get_session
|
|||||||
from nova.db.sqlalchemy import models
|
from nova.db.sqlalchemy import models
|
||||||
|
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
LOG = logging.getLogger('nova.tests.compute')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class InstanceTypeTestCase(test.TestCase):
|
class InstanceTypeTestCase(test.TestCase):
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ except ImportError:
|
|||||||
|
|
||||||
|
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
LOG = logging.getLogger('nova.tests.test_libvirt')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
_fake_network_info = fake_network.fake_get_instance_nw_info
|
_fake_network_info = fake_network.fake_get_instance_nw_info
|
||||||
_ipv4_like = fake_network.ipv4_like
|
_ipv4_like = fake_network.ipv4_like
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ from nova.network import linux_net
|
|||||||
|
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.network')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
HOST = "testhost"
|
HOST = "testhost"
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ from nova.network import manager as network_manager
|
|||||||
from nova.tests import fake_network
|
from nova.tests import fake_network
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.network')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
HOST = "testhost"
|
HOST = "testhost"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ from nova.network import model
|
|||||||
from nova import test
|
from nova import test
|
||||||
from nova.tests import fake_network_cache_model
|
from nova.tests import fake_network_cache_model
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.network')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class RouteTests(test.TestCase):
|
class RouteTests(test.TestCase):
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ from nova import test
|
|||||||
from nova import utils
|
from nova import utils
|
||||||
from nova.network import manager
|
from nova.network import manager
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.quantum_network')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
# this class can be used for unit functional/testing on nova,
|
# this class can be used for unit functional/testing on nova,
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ from nova.tests import utils as test_utils
|
|||||||
libvirt = None
|
libvirt = None
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.test_virt_drivers')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def catch_notimplementederror(f):
|
def catch_notimplementederror(f):
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ from nova import utils
|
|||||||
import nova.volume.api
|
import nova.volume.api
|
||||||
|
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
LOG = logging.getLogger('nova.tests.volume')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class VolumeTestCase(test.TestCase):
|
class VolumeTestCase(test.TestCase):
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ from nova.db.sqlalchemy.session import get_session
|
|||||||
from nova.db.sqlalchemy import models
|
from nova.db.sqlalchemy import models
|
||||||
|
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
LOG = logging.getLogger('nova.tests.test_volume_types')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class VolumeTypeTestCase(test.TestCase):
|
class VolumeTypeTestCase(test.TestCase):
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ from nova.vsa import utils as vsa_utils
|
|||||||
import nova.image.fake
|
import nova.image.fake
|
||||||
|
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
LOG = logging.getLogger('nova.tests.vsa')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class VsaTestCase(test.TestCase):
|
class VsaTestCase(test.TestCase):
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ from nova import log as logging
|
|||||||
import nova.image.fake
|
import nova.image.fake
|
||||||
|
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
LOG = logging.getLogger('nova.tests.vsa.volumes')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class VsaVolumesTestCase(test.TestCase):
|
class VsaVolumesTestCase(test.TestCase):
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ from nova.tests.glance import stubs as glance_stubs
|
|||||||
from nova.tests import fake_network
|
from nova.tests import fake_network
|
||||||
from nova.tests import fake_utils
|
from nova.tests import fake_utils
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.tests.test_xenapi')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ vsa_opts = [
|
|||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
FLAGS.register_opts(vsa_opts)
|
FLAGS.register_opts(vsa_opts)
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.vsa')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class API(base.Base):
|
class API(base.Base):
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ vsa_driver_opt = cfg.StrOpt('vsa_driver',
|
|||||||
FLAGS = flags.FLAGS
|
FLAGS = flags.FLAGS
|
||||||
FLAGS.register_opt(vsa_driver_opt)
|
FLAGS.register_opt(vsa_driver_opt)
|
||||||
|
|
||||||
LOG = logging.getLogger('nova.vsa.manager')
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class VsaManager(manager.SchedulerDependentManager):
|
class VsaManager(manager.SchedulerDependentManager):
|
||||||
|
|||||||
Reference in New Issue
Block a user