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():
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,

View 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,

View 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()

View 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,

View 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.

View 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])

View 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:

View 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()

View 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!"))

View 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,

View 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

View 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,

View 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()

View 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)

View File

@ -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)

View 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(

View 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(

View File

@ -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

View File

@ -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'])

View 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

View 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:

View File

@ -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

View 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()

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 import nsxlib
config.setup_logging(cfg.CONF)
config.setup_logging()
def help(name):

View 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)

View File

@ -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,

View 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(

View 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,

View 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)

View 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')

View 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')