]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Remove unused arg to config.setup_logging()
authorAngus Lees <gus@inodes.org>
Thu, 31 Jul 2014 03:27:57 +0000 (13:27 +1000)
committerAngus Lees <gus@inodes.org>
Fri, 5 Sep 2014 02:05:17 +0000 (12:05 +1000)
The cfg.CFG argument is ignored and misleading.  This change removes it
and updates all callers.

Closes-Bug: #1355565
Change-Id: I2fcece85d1abe848e5c01125cfb62c02f2dcbc86

31 files changed:
neutron/agent/dhcp_agent.py
neutron/agent/l3_agent.py
neutron/agent/metadata/agent.py
neutron/agent/metadata/namespace_proxy.py
neutron/agent/netns_cleanup_util.py
neutron/agent/ovs_cleanup_util.py
neutron/cmd/sanity_check.py
neutron/cmd/usage_audit.py
neutron/common/config.py
neutron/debug/shell.py
neutron/plugins/bigswitch/agent/restproxy_agent.py
neutron/plugins/cisco/cfg_agent/cfg_agent.py
neutron/plugins/hyperv/agent/hyperv_neutron_agent.py
neutron/plugins/ibm/agent/sdnve_neutron_agent.py
neutron/plugins/linuxbridge/agent/linuxbridge_neutron_agent.py
neutron/plugins/ml2/drivers/cisco/apic/apic_topology.py
neutron/plugins/mlnx/agent/eswitch_neutron_agent.py
neutron/plugins/nec/agent/nec_neutron_agent.py
neutron/plugins/ofagent/agent/main.py
neutron/plugins/oneconvergence/agent/nvsd_neutron_agent.py
neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
neutron/plugins/ryu/agent/ryu_neutron_agent.py
neutron/plugins/sriovnicagent/sriov_nic_agent.py
neutron/plugins/vmware/check_nsx_config.py
neutron/service.py
neutron/services/firewall/agents/varmour/varmour_router.py
neutron/services/loadbalancer/agent/agent.py
neutron/services/metering/agents/metering_agent.py
neutron/tests/functional/agent/linux/test_ip_lib.py
neutron/tests/functional/agent/linux/test_keepalived.py
neutron/tests/functional/agent/test_l3_agent.py

index fc0fccc3a93b53d888b003ce26401215f19aa77b..5a501faa91cba10606ea1d86941b94a23abbf33c 100644 (file)
@@ -613,7 +613,7 @@ def register_options():
 def main():
     register_options()
     common_config.init(sys.argv[1:])
-    config.setup_logging(cfg.CONF)
+    config.setup_logging()
     server = neutron_service.Service.create(
         binary='neutron-dhcp-agent',
         topic=topics.DHCP_AGENT,
index f632996d23208f87f8447ca61fcdd21071fdfdc7..99262d78cd74bfb91fffa1972b1b0a2ef1b6f4b5 100644 (file)
@@ -1913,7 +1913,7 @@ def _register_opts(conf):
 def main(manager='neutron.agent.l3_agent.L3NATAgentWithStateReport'):
     _register_opts(cfg.CONF)
     common_config.init(sys.argv[1:])
-    config.setup_logging(cfg.CONF)
+    config.setup_logging()
     server = neutron_service.Service.create(
         binary='neutron-l3-agent',
         topic=topics.L3_AGENT,
index c5b572154cc472a211560052cb4d931bbfbdcf45..3381f149262ba3671de93da128108baddb371257 100644 (file)
@@ -386,7 +386,7 @@ def main():
     cfg.CONF.set_default(name='cache_url', default='memory://?default_ttl=5')
     agent_conf.register_agent_state_opts_helper(cfg.CONF)
     config.init(sys.argv[1:])
-    config.setup_logging(cfg.CONF)
+    config.setup_logging()
     utils.log_opt_values(LOG)
     proxy = UnixDomainMetadataProxy(cfg.CONF)
     proxy.run()
index c6a58c2ec2b1811e841c3cc1deb31bd5896c22dc..9325fdd614bb100e3902302876a62f1a52b9449a 100644 (file)
@@ -169,7 +169,7 @@ def main():
     cfg.CONF.register_cli_opts(opts)
     # Don't get the default configuration file
     cfg.CONF(project='neutron', default_config_files=[])
-    config.setup_logging(cfg.CONF)
+    config.setup_logging()
     utils.log_opt_values(LOG)
     proxy = ProxyDaemon(cfg.CONF.pid_file,
                         cfg.CONF.metadata_port,
index 292c179adb8bbacb1e639592a8cc246c8196e340..771a77f5df1d63c1e1782ba40bea965de44f40b5 100644 (file)
@@ -159,7 +159,7 @@ def main():
     """
     conf = setup_conf()
     conf()
-    config.setup_logging(conf)
+    config.setup_logging()
 
     root_helper = agent_config.get_root_helper(conf)
     # Identify namespaces that are candidates for deletion.
index 1179f103dcabb78158f9557f07a4b3d6d4974184..83337205b24a88f77661061d37c7846d611f98b4 100644 (file)
@@ -81,7 +81,7 @@ def main():
 
     conf = setup_conf()
     conf()
-    config.setup_logging(conf)
+    config.setup_logging()
 
     configuration_bridges = set([conf.ovs_integration_bridge,
                                  conf.external_network_bridge])
index b6522d6d79ec916d886d3c2261dd5cc7a5eda3b7..4b1be1bb708e3b6a6f040b075652d536484160c5 100644 (file)
@@ -114,7 +114,7 @@ def all_tests_passed():
 def main():
     cfg.CONF.register_cli_opts(OPTS)
     cfg.CONF.set_override('use_stderr', True)
-    config.setup_logging(cfg.CONF)
+    config.setup_logging()
     config.init(sys.argv[1:], default_config_files=[])
 
     if cfg.CONF.config_file:
index 78ee7c781fc4c6deb9bff399b53e4264c06025da..d089c66458f1df2fa1b66ec86b8c423410c16048 100644 (file)
@@ -21,8 +21,6 @@ subnets.
 
 import sys
 
-from oslo.config import cfg
-
 from neutron.common import config
 from neutron.common import rpc as n_rpc
 from neutron import context
@@ -31,7 +29,7 @@ from neutron import manager
 
 def main():
     config.init(sys.argv[1:])
-    config.setup_logging(cfg.CONF)
+    config.setup_logging()
 
     cxt = context.get_admin_context()
     plugin = manager.NeutronManager.get_plugin()
index 14429cee57d5d4ee3fe23ff6f7c28c101bbabb1a..cda8d0503bbc91d38e3c096c9effa8e758d61fae 100644 (file)
@@ -157,11 +157,8 @@ def init(args, **kwargs):
         raise Exception(msg)
 
 
-def setup_logging(conf):
-    """Sets up the logging options for a log with supplied name.
-
-    :param conf: a cfg.ConfOpts object
-    """
+def setup_logging():
+    """Sets up the logging options for a log with supplied name."""
     product_name = "neutron"
     logging.setup(product_name)
     LOG.info(_("Logging enabled!"))
index fb37bde7d0074df08df2f18641ff8e83ddea433c..733f0398e95e852042627fbe5e755e5c5a1dfa05 100644 (file)
@@ -76,7 +76,7 @@ class NeutronDebugShell(shell.NeutronShell):
         config.register_use_namespaces_opts_helper(cfg.CONF)
         config.register_root_helper(cfg.CONF)
         cfg.CONF(['--config-file', self.options.config_file])
-        config.setup_logging(cfg.CONF)
+        config.setup_logging()
         driver = importutils.import_object(cfg.CONF.interface_driver, cfg.CONF)
         self.debug_agent = debug_agent.NeutronDebugAgent(cfg.CONF,
                                                          client,
index caf57e4bf60efe148976c626a347ba338fbf14aa..8fb6cdf1256477fced14b7abaee5ee256d031b45 100644 (file)
@@ -166,7 +166,7 @@ class RestProxyAgent(n_rpc.RpcCallback,
 
 def main():
     config.init(sys.argv[1:])
-    config.setup_logging(cfg.CONF)
+    config.setup_logging()
     pl_config.register_config()
 
     integ_br = cfg.CONF.RESTPROXYAGENT.integration_bridge
index a1ae4d8db53e5e7ac8258f911b404284eeadac18..f204952be4d6c9ebb6e5befee46f101fcb4371c6 100644 (file)
@@ -343,7 +343,7 @@ def main(manager='neutron.plugins.cisco.cfg_agent.'
     conf.register_opts(external_process.OPTS)
     common_config.init(sys.argv[1:])
     conf(project='neutron')
-    config.setup_logging(conf)
+    config.setup_logging()
     server = neutron_service.Service.create(
         binary='neutron-cisco-cfg-agent',
         topic=c_constants.CFG_AGENT,
index 6fd00e38eb7c888787d305ae4813db6da438599c..a41cb4a4eec6951fcce24b1db3cf41ebf9b718f4 100644 (file)
@@ -464,7 +464,7 @@ class HyperVNeutronAgent(n_rpc.RpcCallback):
 
 def main():
     common_config.init(sys.argv[1:])
-    common_config.setup_logging(cfg.CONF)
+    common_config.setup_logging()
 
     plugin = HyperVNeutronAgent()
 
index 08d5a08bb8908e9e5b824d8be401cfcfd6237c2e..e2121bf7b787c18242b888d872046ecf4ddb88c3 100644 (file)
@@ -254,7 +254,7 @@ def create_agent_config_map(config):
 def main():
     cfg.CONF.register_opts(ip_lib.OPTS)
     common_config.init(sys.argv[1:])
-    common_config.setup_logging(cfg.CONF)
+    common_config.setup_logging()
 
     try:
         agent_config = create_agent_config_map(cfg.CONF)
index 9af0c105f43eecf73baf73d1a724c46b2429b886..7d608c3e6ee28286c5019a65b06d3602470a9959 100755 (executable)
@@ -1018,7 +1018,7 @@ class LinuxBridgeNeutronAgentRPC(sg_rpc.SecurityGroupAgentRpcMixin):
 def main():
     common_config.init(sys.argv[1:])
 
-    common_config.setup_logging(cfg.CONF)
+    common_config.setup_logging()
     try:
         interface_mappings = q_utils.parse_mappings(
             cfg.CONF.LINUX_BRIDGE.physical_interface_mappings)
index 8f08175cb538c1440c60df10335727ef78645c0d..28b7fcfe322a0866bd0192aed4efc92abb6f4c04 100644 (file)
@@ -331,7 +331,7 @@ class ApicTopologyAgent(manager.Manager):
 def launch(binary, manager, topic=None):
     cfg.CONF(project='neutron')
     common_cfg.init(sys.argv[1:])
-    config.setup_logging(cfg.CONF)
+    config.setup_logging()
     report_period = cfg.CONF.ml2_cisco_apic.apic_agent_report_interval
     poll_period = cfg.CONF.ml2_cisco_apic.apic_agent_poll_interval
     server = service.Service.create(
index cdacb9caa017ef2a9691ae25e172f6f007a6f8ef..3bae841fe3e431486aa24f8f7b411bc603c023e2 100644 (file)
@@ -398,7 +398,7 @@ class MlnxEswitchNeutronAgent(sg_rpc.SecurityGroupAgentRpcMixin):
 
 def main():
     common_config.init(sys.argv[1:])
-    common_config.setup_logging(cfg.CONF)
+    common_config.setup_logging()
 
     try:
         interface_mappings = q_utils.parse_mappings(
index 241503afc0ab64e194b695dd90c8874c4911921d..4060305b0393fa5f6b380ec911a160d813bbda52 100755 (executable)
@@ -235,7 +235,7 @@ class NECNeutronAgent(object):
 def main():
     common_config.init(sys.argv[1:])
 
-    common_config.setup_logging(config.CONF)
+    common_config.setup_logging()
 
     # Determine which agent type to use.
     integ_br = config.OVS.integration_bridge
index df000f0511a199d6ce5f3005125038e71d3ffb09..62332bf822b0cdca31bfcde8291995b9c743eb3f 100755 (executable)
@@ -35,5 +35,5 @@ def main():
     # TODO(yamamoto) remove this later
     if ryu_cfg.CONF is not cfg.CONF:
         ryu_cfg.CONF(project='ryu', args=[])
-    common_config.setup_logging(cfg.CONF)
+    common_config.setup_logging()
     AppManager.run_apps(['neutron.plugins.ofagent.agent.ofa_neutron_agent'])
index 674cc197aad2320290641e297dd565cac6cef574..6181a4443583ab8aeb878ecaa097d8109e9f0c7d 100644 (file)
@@ -164,7 +164,7 @@ class NVSDNeutronAgent(n_rpc.RpcCallback):
 
 def main():
     common_config.init(sys.argv[1:])
-    common_config.setup_logging(config.CONF)
+    common_config.setup_logging()
 
     integ_br = config.AGENT.integration_bridge
     root_helper = config.AGENT.root_helper
index b176b9417416aa76aa255a3b3cf2fe7e780668a5..c0d054e9370b9e68a7ec29ec9711db9ec96d9d59 100644 (file)
@@ -1520,7 +1520,7 @@ def create_agent_config_map(config):
 def main():
     cfg.CONF.register_opts(ip_lib.OPTS)
     common_config.init(sys.argv[1:])
-    common_config.setup_logging(cfg.CONF)
+    common_config.setup_logging()
     q_utils.log_opt_values(LOG)
 
     try:
index dfe9e4ddce91745ef2b17a46bda9e7d8e54e59c0..615e2e93162d63217e8f19f7ed422308686661a1 100755 (executable)
@@ -283,7 +283,7 @@ class OVSNeutronOFPRyuAgent(n_rpc.RpcCallback,
 def main():
     common_config.init(sys.argv[1:])
 
-    common_config.setup_logging(cfg.CONF)
+    common_config.setup_logging()
 
     integ_br = cfg.CONF.OVS.integration_bridge
     polling_interval = cfg.CONF.AGENT.polling_interval
index 886269307f279d7c47290b26b6e9ac93fb52d236..dbfc03c73f03f74c3df70238d6017297705e0602 100644 (file)
@@ -322,7 +322,7 @@ class SriovNicAgentConfigParser(object):
 def main():
     common_config.init(sys.argv[1:])
 
-    common_config.setup_logging(cfg.CONF)
+    common_config.setup_logging()
     try:
         config_parser = SriovNicAgentConfigParser()
         config_parser.parse()
index cb0721edbf64883a73176cc0b573fdb177326951..a063394c1bfa965732804193a7f4885525b0a761 100644 (file)
@@ -24,7 +24,7 @@ from neutron.plugins.vmware.common import config as nsx_config  # noqa
 from neutron.plugins.vmware.common import nsx_utils
 from neutron.plugins.vmware import nsxlib
 
-config.setup_logging(cfg.CONF)
+config.setup_logging()
 
 
 def help(name):
index cf357d16fa351ee33266b3477ed547c3f01eb5fe..34d7f529553cf4a1fb249eada913cbd285438ecc 100644 (file)
@@ -88,7 +88,7 @@ class NeutronApiService(WsgiService):
         # flags. Everything else must be set up in the conf file...
         # Log the options used when starting if we're in debug mode...
 
-        config.setup_logging(cfg.CONF)
+        config.setup_logging()
         # Dump the initial option values
         cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)
         service = cls(app_name)
index e496f119fece0b5fd957968101d8dead1a737d53..3c36f7e907f7c38b44c5996f8f6762ea6655b960 100755 (executable)
@@ -339,7 +339,7 @@ def main():
     conf.register_opts(interface.OPTS)
     conf.register_opts(external_process.OPTS)
     common_config.init(sys.argv[1:])
-    config.setup_logging(conf)
+    config.setup_logging()
     server = neutron_service.Service.create(
         binary='neutron-l3-agent',
         topic=topics.L3_AGENT,
index 0434c688c8fa01737986d9f98380d3a13bf6d174..c6e4f68bc4755b82632f9d3d42edad53fb329ff3 100644 (file)
@@ -59,7 +59,7 @@ def main():
     config.register_root_helper(cfg.CONF)
 
     common_config.init(sys.argv[1:])
-    config.setup_logging(cfg.CONF)
+    config.setup_logging()
 
     mgr = manager.LbaasAgentManager(cfg.CONF)
     svc = LbaasAgentService(
index 2747fe84279367d106dc72116b9386ecce52a000..c22c80b8afbe48388e3fe8b3a727884d5827f105 100644 (file)
@@ -286,7 +286,7 @@ def main():
     config.register_agent_state_opts_helper(conf)
     config.register_root_helper(conf)
     common_config.init(sys.argv[1:])
-    config.setup_logging(conf)
+    config.setup_logging()
     server = neutron_service.Service.create(
         binary='neutron-metering-agent',
         topic=topics.METERING_AGENT,
index c3bd0853d2b5ed5630f8f7cc0e000b1a851a229b..8473bbddcadd1f13f4d66c2043d352218e0df6ac 100644 (file)
@@ -36,7 +36,7 @@ class IpLibTestFramework(base.BaseLinuxTestCase):
         self._configure()
 
     def _configure(self):
-        config.setup_logging(cfg.CONF)
+        config.setup_logging()
         config.register_root_helper(cfg.CONF)
         cfg.CONF.set_override('root_helper', self.root_helper, group='AGENT')
         config.register_interface_driver_opts_helper(cfg.CONF)
index d37a798da47f5ff330de98fd398825af936d3df8..79182671af97a48a3a3bfae44b9d74cc028733d6 100644 (file)
@@ -34,7 +34,7 @@ class KeepalivedManagerTestCase(functional_base.BaseSudoTestCase,
 
     def _configure(self):
         cfg.CONF.set_override('debug', True)
-        config.setup_logging(cfg.CONF)
+        config.setup_logging()
         config.register_root_helper(cfg.CONF)
         cfg.CONF.set_override('root_helper', self.root_helper, group='AGENT')
 
index b5687c9cf3d0c3d9f6d6c85105c8b1906196fb9e..696149b7a3ffca44580e63bc9828dfca2ffa17f0 100644 (file)
@@ -39,7 +39,7 @@ class L3AgentTestFramework(base.BaseOVSLinuxTestCase):
     def _configure(self):
         l3_agent._register_opts(cfg.CONF)
         cfg.CONF.set_override('debug', True)
-        config.setup_logging(cfg.CONF)
+        config.setup_logging()
         cfg.CONF.set_override(
             'interface_driver',
             'neutron.agent.linux.interface.OVSInterfaceDriver')