From a787e7b5d14fa99fefb33606055f5cbd002c50b7 Mon Sep 17 00:00:00 2001 From: Sergey Kraynev Date: Fri, 11 Apr 2014 05:01:12 -0400 Subject: [PATCH] Remove unused logger There are a lot of files contain import logging which is used for creating logger object. However in some files we only have definition of logger without using him. In this patch all unused loggers and imports are deleted. Change-Id: Iedba6d40850cb050c5c25d9b8a6a1d7128fd4bee --- contrib/marconi/marconi/resources/queue.py | 4 ---- contrib/rackspace/rackspace/tests/test_rackspace_dns.py | 3 --- heat/api/cfn/v1/__init__.py | 3 --- heat/api/cloudwatch/__init__.py | 2 -- heat/api/middleware/fault.py | 3 --- heat/api/openstack/v1/__init__.py | 3 --- heat/common/crypt.py | 3 --- heat/common/policy.py | 3 --- heat/engine/hot/parameters.py | 3 --- heat/engine/hot/template.py | 3 --- heat/engine/resources/cloud_watch.py | 3 --- heat/engine/resources/internet_gateway.py | 3 --- heat/engine/resources/network_interface.py | 3 --- heat/engine/resources/neutron/firewall.py | 3 --- heat/engine/resources/neutron/floatingip.py | 3 --- heat/engine/resources/neutron/net.py | 3 --- heat/engine/resources/neutron/network_gateway.py | 3 --- heat/engine/resources/neutron/router.py | 3 --- heat/engine/resources/neutron/security_group.py | 3 --- heat/engine/resources/neutron/subnet.py | 3 --- heat/engine/resources/neutron/vpnservice.py | 3 --- heat/engine/resources/nova_keypair.py | 3 --- heat/engine/resources/route_table.py | 3 --- heat/engine/resources/security_group.py | 3 --- heat/engine/resources/stack.py | 3 --- heat/engine/resources/subnet.py | 3 --- heat/engine/resources/template_resource.py | 3 --- heat/engine/resources/vpc.py | 3 --- 28 files changed, 84 deletions(-) diff --git a/contrib/marconi/marconi/resources/queue.py b/contrib/marconi/marconi/resources/queue.py index 00338d1580..495f45460f 100644 --- a/contrib/marconi/marconi/resources/queue.py +++ b/contrib/marconi/marconi/resources/queue.py @@ -14,14 +14,10 @@ from heat.common import exception from heat.engine import properties from heat.engine import resource -from heat.openstack.common import log as logging from .. import clients # noqa -logger = logging.getLogger(__name__) - - if clients.marconiclient is None: def resource_mapping(): return {} diff --git a/contrib/rackspace/rackspace/tests/test_rackspace_dns.py b/contrib/rackspace/rackspace/tests/test_rackspace_dns.py index 1c1856a307..4dadbca65d 100644 --- a/contrib/rackspace/rackspace/tests/test_rackspace_dns.py +++ b/contrib/rackspace/rackspace/tests/test_rackspace_dns.py @@ -19,14 +19,11 @@ from heat.engine import environment from heat.engine import parser from heat.engine import resource from heat.engine import scheduler -from heat.openstack.common import log as logging from heat.tests import common from heat.tests import utils from ..resources import cloud_dns # noqa -logger = logging.getLogger(__name__) - domain_only_template = ''' { "AWSTemplateFormatVersion" : "2010-09-09", diff --git a/heat/api/cfn/v1/__init__.py b/heat/api/cfn/v1/__init__.py index 91ea06e21c..83582f1529 100644 --- a/heat/api/cfn/v1/__init__.py +++ b/heat/api/cfn/v1/__init__.py @@ -17,9 +17,6 @@ from webob import Request from heat.api.cfn.v1 import signal from heat.api.cfn.v1 import stacks from heat.common import wsgi -from heat.openstack.common import log as logging - -logger = logging.getLogger(__name__) class API(wsgi.Router): diff --git a/heat/api/cloudwatch/__init__.py b/heat/api/cloudwatch/__init__.py index 8d4f60630c..613b008735 100644 --- a/heat/api/cloudwatch/__init__.py +++ b/heat/api/cloudwatch/__init__.py @@ -19,9 +19,7 @@ from heat.api.cloudwatch import watch from heat.api.middleware.version_negotiation import VersionNegotiationFilter from heat.common import wsgi from heat.openstack.common import gettextutils -from heat.openstack.common import log as logging -logger = logging.getLogger(__name__) gettextutils.install('heat') diff --git a/heat/api/middleware/fault.py b/heat/api/middleware/fault.py index 3894b4b7be..382ec76641 100644 --- a/heat/api/middleware/fault.py +++ b/heat/api/middleware/fault.py @@ -29,13 +29,10 @@ cfg.CONF.import_opt('debug', 'heat.openstack.common.log') from heat.common import serializers from heat.common import exception -from heat.openstack.common import log as logging import heat.openstack.common.rpc.common as rpc_common from heat.common import wsgi -logger = logging.getLogger(__name__) - class Fault(object): diff --git a/heat/api/openstack/v1/__init__.py b/heat/api/openstack/v1/__init__.py index c4e14f4e22..6fd1f60498 100644 --- a/heat/api/openstack/v1/__init__.py +++ b/heat/api/openstack/v1/__init__.py @@ -21,9 +21,6 @@ from heat.api.openstack.v1 import software_configs from heat.api.openstack.v1 import software_deployments from heat.api.openstack.v1 import stacks from heat.common import wsgi -from heat.openstack.common import log as logging - -logger = logging.getLogger(__name__) class API(wsgi.Router): diff --git a/heat/common/crypt.py b/heat/common/crypt.py index 7bf3b6d646..12883e599d 100644 --- a/heat/common/crypt.py +++ b/heat/common/crypt.py @@ -16,7 +16,6 @@ from Crypto.Cipher import AES from oslo.config import cfg from heat.openstack.common.crypto import utils -from heat.openstack.common import log as logging auth_opts = [ @@ -27,8 +26,6 @@ auth_opts = [ cfg.CONF.register_opts(auth_opts) -logger = logging.getLogger(__name__) - def encrypt(auth_info): if auth_info is None: diff --git a/heat/common/policy.py b/heat/common/policy.py index 179c854cbb..29644782a0 100644 --- a/heat/common/policy.py +++ b/heat/common/policy.py @@ -21,11 +21,8 @@ from oslo.config import cfg from heat.common import exception -import heat.openstack.common.log as logging from heat.openstack.common import policy -logger = logging.getLogger(__name__) - CONF = cfg.CONF diff --git a/heat/engine/hot/parameters.py b/heat/engine/hot/parameters.py index 79fc70fb5b..e7bf5a5b90 100644 --- a/heat/engine/hot/parameters.py +++ b/heat/engine/hot/parameters.py @@ -14,9 +14,6 @@ from heat.engine import constraints as constr from heat.engine import parameters -from heat.openstack.common import log as logging - -logger = logging.getLogger(__name__) PARAM_CONSTRAINTS = ( diff --git a/heat/engine/hot/template.py b/heat/engine/hot/template.py index 8fb4bdfe72..cf5363407f 100644 --- a/heat/engine/hot/template.py +++ b/heat/engine/hot/template.py @@ -14,9 +14,6 @@ from heat.engine.cfn import template as cfn_template from heat.engine.hot import parameters from heat.engine import template from heat.openstack.common.gettextutils import _ -from heat.openstack.common import log as logging - -logger = logging.getLogger(__name__) class HOTemplate(template.Template): diff --git a/heat/engine/resources/cloud_watch.py b/heat/engine/resources/cloud_watch.py index 6781c73b0a..9bda057dde 100644 --- a/heat/engine/resources/cloud_watch.py +++ b/heat/engine/resources/cloud_watch.py @@ -17,9 +17,6 @@ from heat.engine import properties from heat.engine.properties import Properties from heat.engine import resource from heat.engine import watchrule -from heat.openstack.common import log as logging - -logger = logging.getLogger(__name__) class CloudWatchAlarm(resource.Resource): diff --git a/heat/engine/resources/internet_gateway.py b/heat/engine/resources/internet_gateway.py index 1399377428..42acea25e9 100644 --- a/heat/engine/resources/internet_gateway.py +++ b/heat/engine/resources/internet_gateway.py @@ -17,9 +17,6 @@ from heat.engine import properties from heat.engine import resource from heat.engine.resources import route_table from heat.openstack.common.gettextutils import _ -from heat.openstack.common import log as logging - -logger = logging.getLogger(__name__) class InternetGateway(resource.Resource): diff --git a/heat/engine/resources/network_interface.py b/heat/engine/resources/network_interface.py index 4e7e4d2481..b46a2a11a1 100644 --- a/heat/engine/resources/network_interface.py +++ b/heat/engine/resources/network_interface.py @@ -15,9 +15,6 @@ from heat.engine import clients from heat.engine import properties from heat.engine import resource from heat.engine.resources.neutron import neutron -from heat.openstack.common import log as logging - -logger = logging.getLogger(__name__) class NetworkInterface(resource.Resource): diff --git a/heat/engine/resources/neutron/firewall.py b/heat/engine/resources/neutron/firewall.py index dcd26ab78f..e6070c810f 100644 --- a/heat/engine/resources/neutron/firewall.py +++ b/heat/engine/resources/neutron/firewall.py @@ -15,13 +15,10 @@ from heat.engine import clients from heat.engine import constraints from heat.engine import properties from heat.engine.resources.neutron import neutron -from heat.openstack.common import log as logging if clients.neutronclient is not None: from neutronclient.common.exceptions import NeutronClientException -logger = logging.getLogger(__name__) - class Firewall(neutron.NeutronResource): """ diff --git a/heat/engine/resources/neutron/floatingip.py b/heat/engine/resources/neutron/floatingip.py index 6f69002d37..8d3faf18dd 100644 --- a/heat/engine/resources/neutron/floatingip.py +++ b/heat/engine/resources/neutron/floatingip.py @@ -15,13 +15,10 @@ from heat.engine import clients from heat.engine import properties from heat.engine.resources.neutron import neutron from heat.engine.resources.neutron import router -from heat.openstack.common import log as logging if clients.neutronclient is not None: from neutronclient.common.exceptions import NeutronClientException -logger = logging.getLogger(__name__) - class FloatingIP(neutron.NeutronResource): PROPERTIES = ( diff --git a/heat/engine/resources/neutron/net.py b/heat/engine/resources/neutron/net.py index 05f649f736..ca2a0e1300 100644 --- a/heat/engine/resources/neutron/net.py +++ b/heat/engine/resources/neutron/net.py @@ -14,14 +14,11 @@ from heat.engine import clients from heat.engine import properties from heat.engine.resources.neutron import neutron -from heat.openstack.common import log as logging if clients.neutronclient is not None: import neutronclient.common.exceptions as neutron_exp from neutronclient.neutron import v2_0 as neutronV20 -logger = logging.getLogger(__name__) - class Net(neutron.NeutronResource): PROPERTIES = ( diff --git a/heat/engine/resources/neutron/network_gateway.py b/heat/engine/resources/neutron/network_gateway.py index 9610b91147..b1bce9bfaa 100644 --- a/heat/engine/resources/neutron/network_gateway.py +++ b/heat/engine/resources/neutron/network_gateway.py @@ -19,13 +19,10 @@ from heat.engine import clients from heat.engine import constraints from heat.engine import properties from heat.engine.resources.neutron import neutron -from heat.openstack.common import log as logging if clients.neutronclient is not None: from neutronclient.common.exceptions import NeutronClientException -logger = logging.getLogger(__name__) - class NetworkGateway(neutron.NeutronResource): ''' diff --git a/heat/engine/resources/neutron/router.py b/heat/engine/resources/neutron/router.py index 199ec88159..fd7ec281b0 100644 --- a/heat/engine/resources/neutron/router.py +++ b/heat/engine/resources/neutron/router.py @@ -17,14 +17,11 @@ from heat.engine import properties from heat.engine.resources.neutron import neutron from heat.engine.resources.neutron import subnet from heat.engine import support -from heat.openstack.common import log as logging if clients.neutronclient is not None: from neutronclient.common.exceptions import NeutronClientException from neutronclient.neutron import v2_0 as neutronV20 -logger = logging.getLogger(__name__) - class Router(neutron.NeutronResource): diff --git a/heat/engine/resources/neutron/security_group.py b/heat/engine/resources/neutron/security_group.py index 23227b3de6..7a4dcd9b2b 100644 --- a/heat/engine/resources/neutron/security_group.py +++ b/heat/engine/resources/neutron/security_group.py @@ -16,13 +16,10 @@ from heat.engine import clients from heat.engine import constraints from heat.engine import properties from heat.engine.resources.neutron import neutron -from heat.openstack.common import log as logging if clients.neutronclient is not None: import neutronclient.common.exceptions as neutron_exp -logger = logging.getLogger(__name__) - class SecurityGroup(neutron.NeutronResource): diff --git a/heat/engine/resources/neutron/subnet.py b/heat/engine/resources/neutron/subnet.py index 9bb8f1ae2f..7ae6f1e280 100644 --- a/heat/engine/resources/neutron/subnet.py +++ b/heat/engine/resources/neutron/subnet.py @@ -15,13 +15,10 @@ from heat.engine import clients from heat.engine import constraints from heat.engine import properties from heat.engine.resources.neutron import neutron -from heat.openstack.common import log as logging if clients.neutronclient is not None: from neutronclient.common.exceptions import NeutronClientException -logger = logging.getLogger(__name__) - class Subnet(neutron.NeutronResource): diff --git a/heat/engine/resources/neutron/vpnservice.py b/heat/engine/resources/neutron/vpnservice.py index 4d1204ad02..70a51047bc 100644 --- a/heat/engine/resources/neutron/vpnservice.py +++ b/heat/engine/resources/neutron/vpnservice.py @@ -15,13 +15,10 @@ from heat.engine import clients from heat.engine import constraints from heat.engine import properties from heat.engine.resources.neutron import neutron -from heat.openstack.common import log as logging if clients.neutronclient is not None: from neutronclient.common.exceptions import NeutronClientException -logger = logging.getLogger(__name__) - class VPNService(neutron.NeutronResource): """ diff --git a/heat/engine/resources/nova_keypair.py b/heat/engine/resources/nova_keypair.py index 591141f78c..9642f7a978 100644 --- a/heat/engine/resources/nova_keypair.py +++ b/heat/engine/resources/nova_keypair.py @@ -20,9 +20,6 @@ from heat.engine import properties from heat.engine import resource from heat.engine.resources import nova_utils from heat.openstack.common.gettextutils import _ -from heat.openstack.common import log as logging - -logger = logging.getLogger(__name__) class KeyPair(resource.Resource): diff --git a/heat/engine/resources/route_table.py b/heat/engine/resources/route_table.py index 43b9d23a29..4688d24504 100644 --- a/heat/engine/resources/route_table.py +++ b/heat/engine/resources/route_table.py @@ -16,13 +16,10 @@ from heat.engine import properties from heat.engine import resource from heat.engine.resources.neutron import neutron from heat.engine.resources.vpc import VPC -from heat.openstack.common import log as logging if clients.neutronclient is not None: from neutronclient.common.exceptions import NeutronClientException -logger = logging.getLogger(__name__) - class RouteTable(resource.Resource): diff --git a/heat/engine/resources/security_group.py b/heat/engine/resources/security_group.py index 2f9cc066ae..2a33d5cbed 100644 --- a/heat/engine/resources/security_group.py +++ b/heat/engine/resources/security_group.py @@ -15,9 +15,6 @@ from heat.common import exception from heat.engine import clients from heat.engine import properties from heat.engine import resource -from heat.openstack.common import log as logging - -logger = logging.getLogger(__name__) class SecurityGroup(resource.Resource): diff --git a/heat/engine/resources/stack.py b/heat/engine/resources/stack.py index d055c28740..c685a6cffe 100644 --- a/heat/engine/resources/stack.py +++ b/heat/engine/resources/stack.py @@ -19,9 +19,6 @@ from heat.common import urlfetch from heat.engine import properties from heat.engine.properties import Properties from heat.engine import stack_resource -from heat.openstack.common import log as logging - -logger = logging.getLogger(__name__) class NestedStack(stack_resource.StackResource): diff --git a/heat/engine/resources/subnet.py b/heat/engine/resources/subnet.py index 14265a81a1..40344b4ca2 100644 --- a/heat/engine/resources/subnet.py +++ b/heat/engine/resources/subnet.py @@ -16,9 +16,6 @@ from heat.engine import clients from heat.engine import properties from heat.engine import resource from heat.engine.resources.vpc import VPC -from heat.openstack.common import log as logging - -logger = logging.getLogger(__name__) class Subnet(resource.Resource): diff --git a/heat/engine/resources/template_resource.py b/heat/engine/resources/template_resource.py index f2a938519a..cc8d204fe0 100644 --- a/heat/engine/resources/template_resource.py +++ b/heat/engine/resources/template_resource.py @@ -25,9 +25,6 @@ from heat.engine import environment from heat.engine import properties from heat.engine import stack_resource from heat.engine import template -from heat.openstack.common import log as logging - -logger = logging.getLogger(__name__) def generate_class(name, template_name): diff --git a/heat/engine/resources/vpc.py b/heat/engine/resources/vpc.py index b1e0c5a545..5a1685ae45 100644 --- a/heat/engine/resources/vpc.py +++ b/heat/engine/resources/vpc.py @@ -17,9 +17,6 @@ from heat.engine import constraints from heat.engine import properties from heat.engine import resource from heat.engine.resources.neutron import neutron -from heat.openstack.common import log as logging - -logger = logging.getLogger(__name__) class VPC(resource.Resource):