Remove unused arg to config.setup_logging()

The cfg.CFG argument is ignored and misleading.  This change removes it
and updates all callers.

Closes-Bug: #1355565
Change-Id: I2fcece85d1abe848e5c01125cfb62c02f2dcbc86
This commit is contained in:
Angus Lees 2014-07-31 13:27:57 +10:00
parent 3b46f2ca28
commit 5defcd0aa6
31 changed files with 32 additions and 37 deletions

View File

@ -613,7 +613,7 @@ def register_options():
def main(): def main():
register_options() register_options()
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
config.setup_logging(cfg.CONF) config.setup_logging()
server = neutron_service.Service.create( server = neutron_service.Service.create(
binary='neutron-dhcp-agent', binary='neutron-dhcp-agent',
topic=topics.DHCP_AGENT, topic=topics.DHCP_AGENT,

View File

@ -1913,7 +1913,7 @@ def _register_opts(conf):
def main(manager='neutron.agent.l3_agent.L3NATAgentWithStateReport'): def main(manager='neutron.agent.l3_agent.L3NATAgentWithStateReport'):
_register_opts(cfg.CONF) _register_opts(cfg.CONF)
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
config.setup_logging(cfg.CONF) config.setup_logging()
server = neutron_service.Service.create( server = neutron_service.Service.create(
binary='neutron-l3-agent', binary='neutron-l3-agent',
topic=topics.L3_AGENT, topic=topics.L3_AGENT,

View File

@ -386,7 +386,7 @@ def main():
cfg.CONF.set_default(name='cache_url', default='memory://?default_ttl=5') cfg.CONF.set_default(name='cache_url', default='memory://?default_ttl=5')
agent_conf.register_agent_state_opts_helper(cfg.CONF) agent_conf.register_agent_state_opts_helper(cfg.CONF)
config.init(sys.argv[1:]) config.init(sys.argv[1:])
config.setup_logging(cfg.CONF) config.setup_logging()
utils.log_opt_values(LOG) utils.log_opt_values(LOG)
proxy = UnixDomainMetadataProxy(cfg.CONF) proxy = UnixDomainMetadataProxy(cfg.CONF)
proxy.run() proxy.run()

View File

@ -169,7 +169,7 @@ def main():
cfg.CONF.register_cli_opts(opts) cfg.CONF.register_cli_opts(opts)
# Don't get the default configuration file # Don't get the default configuration file
cfg.CONF(project='neutron', default_config_files=[]) cfg.CONF(project='neutron', default_config_files=[])
config.setup_logging(cfg.CONF) config.setup_logging()
utils.log_opt_values(LOG) utils.log_opt_values(LOG)
proxy = ProxyDaemon(cfg.CONF.pid_file, proxy = ProxyDaemon(cfg.CONF.pid_file,
cfg.CONF.metadata_port, cfg.CONF.metadata_port,

View File

@ -159,7 +159,7 @@ def main():
""" """
conf = setup_conf() conf = setup_conf()
conf() conf()
config.setup_logging(conf) config.setup_logging()
root_helper = agent_config.get_root_helper(conf) root_helper = agent_config.get_root_helper(conf)
# Identify namespaces that are candidates for deletion. # Identify namespaces that are candidates for deletion.

View File

@ -81,7 +81,7 @@ def main():
conf = setup_conf() conf = setup_conf()
conf() conf()
config.setup_logging(conf) config.setup_logging()
configuration_bridges = set([conf.ovs_integration_bridge, configuration_bridges = set([conf.ovs_integration_bridge,
conf.external_network_bridge]) conf.external_network_bridge])

View File

@ -114,7 +114,7 @@ def all_tests_passed():
def main(): def main():
cfg.CONF.register_cli_opts(OPTS) cfg.CONF.register_cli_opts(OPTS)
cfg.CONF.set_override('use_stderr', True) cfg.CONF.set_override('use_stderr', True)
config.setup_logging(cfg.CONF) config.setup_logging()
config.init(sys.argv[1:], default_config_files=[]) config.init(sys.argv[1:], default_config_files=[])
if cfg.CONF.config_file: if cfg.CONF.config_file:

View File

@ -21,8 +21,6 @@ subnets.
import sys import sys
from oslo.config import cfg
from neutron.common import config from neutron.common import config
from neutron.common import rpc as n_rpc from neutron.common import rpc as n_rpc
from neutron import context from neutron import context
@ -31,7 +29,7 @@ from neutron import manager
def main(): def main():
config.init(sys.argv[1:]) config.init(sys.argv[1:])
config.setup_logging(cfg.CONF) config.setup_logging()
cxt = context.get_admin_context() cxt = context.get_admin_context()
plugin = manager.NeutronManager.get_plugin() plugin = manager.NeutronManager.get_plugin()

View File

@ -157,11 +157,8 @@ def init(args, **kwargs):
raise Exception(msg) raise Exception(msg)
def setup_logging(conf): def setup_logging():
"""Sets up the logging options for a log with supplied name. """Sets up the logging options for a log with supplied name."""
:param conf: a cfg.ConfOpts object
"""
product_name = "neutron" product_name = "neutron"
logging.setup(product_name) logging.setup(product_name)
LOG.info(_("Logging enabled!")) LOG.info(_("Logging enabled!"))

View File

@ -76,7 +76,7 @@ class NeutronDebugShell(shell.NeutronShell):
config.register_use_namespaces_opts_helper(cfg.CONF) config.register_use_namespaces_opts_helper(cfg.CONF)
config.register_root_helper(cfg.CONF) config.register_root_helper(cfg.CONF)
cfg.CONF(['--config-file', self.options.config_file]) 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) driver = importutils.import_object(cfg.CONF.interface_driver, cfg.CONF)
self.debug_agent = debug_agent.NeutronDebugAgent(cfg.CONF, self.debug_agent = debug_agent.NeutronDebugAgent(cfg.CONF,
client, client,

View File

@ -166,7 +166,7 @@ class RestProxyAgent(n_rpc.RpcCallback,
def main(): def main():
config.init(sys.argv[1:]) config.init(sys.argv[1:])
config.setup_logging(cfg.CONF) config.setup_logging()
pl_config.register_config() pl_config.register_config()
integ_br = cfg.CONF.RESTPROXYAGENT.integration_bridge integ_br = cfg.CONF.RESTPROXYAGENT.integration_bridge

View File

@ -343,7 +343,7 @@ def main(manager='neutron.plugins.cisco.cfg_agent.'
conf.register_opts(external_process.OPTS) conf.register_opts(external_process.OPTS)
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
conf(project='neutron') conf(project='neutron')
config.setup_logging(conf) config.setup_logging()
server = neutron_service.Service.create( server = neutron_service.Service.create(
binary='neutron-cisco-cfg-agent', binary='neutron-cisco-cfg-agent',
topic=c_constants.CFG_AGENT, topic=c_constants.CFG_AGENT,

View File

@ -464,7 +464,7 @@ class HyperVNeutronAgent(n_rpc.RpcCallback):
def main(): def main():
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
common_config.setup_logging(cfg.CONF) common_config.setup_logging()
plugin = HyperVNeutronAgent() plugin = HyperVNeutronAgent()

View File

@ -254,7 +254,7 @@ def create_agent_config_map(config):
def main(): def main():
cfg.CONF.register_opts(ip_lib.OPTS) cfg.CONF.register_opts(ip_lib.OPTS)
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
common_config.setup_logging(cfg.CONF) common_config.setup_logging()
try: try:
agent_config = create_agent_config_map(cfg.CONF) agent_config = create_agent_config_map(cfg.CONF)

View File

@ -1018,7 +1018,7 @@ class LinuxBridgeNeutronAgentRPC(sg_rpc.SecurityGroupAgentRpcMixin):
def main(): def main():
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
common_config.setup_logging(cfg.CONF) common_config.setup_logging()
try: try:
interface_mappings = q_utils.parse_mappings( interface_mappings = q_utils.parse_mappings(
cfg.CONF.LINUX_BRIDGE.physical_interface_mappings) cfg.CONF.LINUX_BRIDGE.physical_interface_mappings)

View File

@ -331,7 +331,7 @@ class ApicTopologyAgent(manager.Manager):
def launch(binary, manager, topic=None): def launch(binary, manager, topic=None):
cfg.CONF(project='neutron') cfg.CONF(project='neutron')
common_cfg.init(sys.argv[1:]) 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 report_period = cfg.CONF.ml2_cisco_apic.apic_agent_report_interval
poll_period = cfg.CONF.ml2_cisco_apic.apic_agent_poll_interval poll_period = cfg.CONF.ml2_cisco_apic.apic_agent_poll_interval
server = service.Service.create( server = service.Service.create(

View File

@ -398,7 +398,7 @@ class MlnxEswitchNeutronAgent(sg_rpc.SecurityGroupAgentRpcMixin):
def main(): def main():
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
common_config.setup_logging(cfg.CONF) common_config.setup_logging()
try: try:
interface_mappings = q_utils.parse_mappings( interface_mappings = q_utils.parse_mappings(

View File

@ -235,7 +235,7 @@ class NECNeutronAgent(object):
def main(): def main():
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
common_config.setup_logging(config.CONF) common_config.setup_logging()
# Determine which agent type to use. # Determine which agent type to use.
integ_br = config.OVS.integration_bridge integ_br = config.OVS.integration_bridge

View File

@ -35,5 +35,5 @@ def main():
# TODO(yamamoto) remove this later # TODO(yamamoto) remove this later
if ryu_cfg.CONF is not cfg.CONF: if ryu_cfg.CONF is not cfg.CONF:
ryu_cfg.CONF(project='ryu', args=[]) 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']) AppManager.run_apps(['neutron.plugins.ofagent.agent.ofa_neutron_agent'])

View File

@ -164,7 +164,7 @@ class NVSDNeutronAgent(n_rpc.RpcCallback):
def main(): def main():
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
common_config.setup_logging(config.CONF) common_config.setup_logging()
integ_br = config.AGENT.integration_bridge integ_br = config.AGENT.integration_bridge
root_helper = config.AGENT.root_helper root_helper = config.AGENT.root_helper

View File

@ -1520,7 +1520,7 @@ def create_agent_config_map(config):
def main(): def main():
cfg.CONF.register_opts(ip_lib.OPTS) cfg.CONF.register_opts(ip_lib.OPTS)
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
common_config.setup_logging(cfg.CONF) common_config.setup_logging()
q_utils.log_opt_values(LOG) q_utils.log_opt_values(LOG)
try: try:

View File

@ -283,7 +283,7 @@ class OVSNeutronOFPRyuAgent(n_rpc.RpcCallback,
def main(): def main():
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
common_config.setup_logging(cfg.CONF) common_config.setup_logging()
integ_br = cfg.CONF.OVS.integration_bridge integ_br = cfg.CONF.OVS.integration_bridge
polling_interval = cfg.CONF.AGENT.polling_interval polling_interval = cfg.CONF.AGENT.polling_interval

View File

@ -322,7 +322,7 @@ class SriovNicAgentConfigParser(object):
def main(): def main():
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
common_config.setup_logging(cfg.CONF) common_config.setup_logging()
try: try:
config_parser = SriovNicAgentConfigParser() config_parser = SriovNicAgentConfigParser()
config_parser.parse() config_parser.parse()

View 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.common import nsx_utils
from neutron.plugins.vmware import nsxlib from neutron.plugins.vmware import nsxlib
config.setup_logging(cfg.CONF) config.setup_logging()
def help(name): def help(name):

View File

@ -88,7 +88,7 @@ class NeutronApiService(WsgiService):
# flags. Everything else must be set up in the conf file... # flags. Everything else must be set up in the conf file...
# Log the options used when starting if we're in debug mode... # 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 # Dump the initial option values
cfg.CONF.log_opt_values(LOG, std_logging.DEBUG) cfg.CONF.log_opt_values(LOG, std_logging.DEBUG)
service = cls(app_name) service = cls(app_name)

View File

@ -339,7 +339,7 @@ def main():
conf.register_opts(interface.OPTS) conf.register_opts(interface.OPTS)
conf.register_opts(external_process.OPTS) conf.register_opts(external_process.OPTS)
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
config.setup_logging(conf) config.setup_logging()
server = neutron_service.Service.create( server = neutron_service.Service.create(
binary='neutron-l3-agent', binary='neutron-l3-agent',
topic=topics.L3_AGENT, topic=topics.L3_AGENT,

View File

@ -59,7 +59,7 @@ def main():
config.register_root_helper(cfg.CONF) config.register_root_helper(cfg.CONF)
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
config.setup_logging(cfg.CONF) config.setup_logging()
mgr = manager.LbaasAgentManager(cfg.CONF) mgr = manager.LbaasAgentManager(cfg.CONF)
svc = LbaasAgentService( svc = LbaasAgentService(

View File

@ -286,7 +286,7 @@ def main():
config.register_agent_state_opts_helper(conf) config.register_agent_state_opts_helper(conf)
config.register_root_helper(conf) config.register_root_helper(conf)
common_config.init(sys.argv[1:]) common_config.init(sys.argv[1:])
config.setup_logging(conf) config.setup_logging()
server = neutron_service.Service.create( server = neutron_service.Service.create(
binary='neutron-metering-agent', binary='neutron-metering-agent',
topic=topics.METERING_AGENT, topic=topics.METERING_AGENT,

View File

@ -36,7 +36,7 @@ class IpLibTestFramework(base.BaseLinuxTestCase):
self._configure() self._configure()
def _configure(self): def _configure(self):
config.setup_logging(cfg.CONF) config.setup_logging()
config.register_root_helper(cfg.CONF) config.register_root_helper(cfg.CONF)
cfg.CONF.set_override('root_helper', self.root_helper, group='AGENT') cfg.CONF.set_override('root_helper', self.root_helper, group='AGENT')
config.register_interface_driver_opts_helper(cfg.CONF) config.register_interface_driver_opts_helper(cfg.CONF)

View File

@ -34,7 +34,7 @@ class KeepalivedManagerTestCase(functional_base.BaseSudoTestCase,
def _configure(self): def _configure(self):
cfg.CONF.set_override('debug', True) cfg.CONF.set_override('debug', True)
config.setup_logging(cfg.CONF) config.setup_logging()
config.register_root_helper(cfg.CONF) config.register_root_helper(cfg.CONF)
cfg.CONF.set_override('root_helper', self.root_helper, group='AGENT') cfg.CONF.set_override('root_helper', self.root_helper, group='AGENT')

View File

@ -39,7 +39,7 @@ class L3AgentTestFramework(base.BaseOVSLinuxTestCase):
def _configure(self): def _configure(self):
l3_agent._register_opts(cfg.CONF) l3_agent._register_opts(cfg.CONF)
cfg.CONF.set_override('debug', True) cfg.CONF.set_override('debug', True)
config.setup_logging(cfg.CONF) config.setup_logging()
cfg.CONF.set_override( cfg.CONF.set_override(
'interface_driver', 'interface_driver',
'neutron.agent.linux.interface.OVSInterfaceDriver') 'neutron.agent.linux.interface.OVSInterfaceDriver')