Skip to content

Commit

Permalink
Remove unused arg to config.setup_logging()
Browse files Browse the repository at this point in the history
The cfg.CFG argument is ignored and misleading.  This change removes it
and updates all callers.

Closes-Bug: #1355565
Change-Id: I2fcece85d1abe848e5c01125cfb62c02f2dcbc86
  • Loading branch information
anguslees committed Sep 5, 2014
1 parent 3b46f2c commit 5defcd0
Show file tree
Hide file tree
Showing 31 changed files with 32 additions and 37 deletions.
2 changes: 1 addition & 1 deletion neutron/agent/dhcp_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/l3_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/metadata/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
2 changes: 1 addition & 1 deletion neutron/agent/metadata/namespace_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/netns_cleanup_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion neutron/agent/ovs_cleanup_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down
2 changes: 1 addition & 1 deletion neutron/cmd/sanity_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 1 addition & 3 deletions neutron/cmd/usage_audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

import sys

from oslo.config import cfg

from neutron.common import config
from neutron.common import rpc as n_rpc
from neutron import context
Expand All @@ -31,7 +29,7 @@

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()
Expand Down
7 changes: 2 additions & 5 deletions neutron/common/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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!"))
Expand Down
2 changes: 1 addition & 1 deletion neutron/debug/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def initialize_app(self, argv):
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,
Expand Down
2 changes: 1 addition & 1 deletion neutron/plugins/bigswitch/agent/restproxy_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def daemon_loop(self):

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
Expand Down
2 changes: 1 addition & 1 deletion neutron/plugins/cisco/cfg_agent/cfg_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion neutron/plugins/hyperv/agent/hyperv_neutron_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ def daemon_loop(self):

def main():
common_config.init(sys.argv[1:])
common_config.setup_logging(cfg.CONF)
common_config.setup_logging()

plugin = HyperVNeutronAgent()

Expand Down
2 changes: 1 addition & 1 deletion neutron/plugins/ibm/agent/sdnve_neutron_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,7 @@ def daemon_loop(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion neutron/plugins/ml2/drivers/cisco/apic/apic_topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def report_send(self, context):
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(
Expand Down
2 changes: 1 addition & 1 deletion neutron/plugins/mlnx/agent/eswitch_neutron_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ def daemon_loop(self):

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(
Expand Down
2 changes: 1 addition & 1 deletion neutron/plugins/nec/agent/nec_neutron_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def daemon_loop(self):
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
Expand Down
2 changes: 1 addition & 1 deletion neutron/plugins/ofagent/agent/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
2 changes: 1 addition & 1 deletion neutron/plugins/oneconvergence/agent/nvsd_neutron_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def daemon_loop(self):

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
Expand Down
2 changes: 1 addition & 1 deletion neutron/plugins/openvswitch/agent/ovs_neutron_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion neutron/plugins/ryu/agent/ryu_neutron_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def daemon_loop(self):
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
Expand Down
2 changes: 1 addition & 1 deletion neutron/plugins/sriovnicagent/sriov_nic_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def _validate(self):
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()
Expand Down
2 changes: 1 addition & 1 deletion neutron/plugins/vmware/check_nsx_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
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):
Expand Down
2 changes: 1 addition & 1 deletion neutron/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def create(cls, app_name='neutron'):
# 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)
Expand Down
2 changes: 1 addition & 1 deletion neutron/services/firewall/agents/varmour/varmour_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion neutron/services/loadbalancer/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion neutron/services/metering/agents/metering_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion neutron/tests/functional/agent/linux/test_ip_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def setUp(self):
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)
Expand Down
2 changes: 1 addition & 1 deletion neutron/tests/functional/agent/linux/test_keepalived.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def setUp(self):

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

Expand Down
2 changes: 1 addition & 1 deletion neutron/tests/functional/agent/test_l3_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def setUp(self):
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')
Expand Down

0 comments on commit 5defcd0

Please sign in to comment.