From 47381ff70a9be29a1a3d853c4ff84f51a8c8618b Mon Sep 17 00:00:00 2001 From: Yong Sheng Gong Date: Fri, 12 Jul 2013 17:18:42 +0800 Subject: [PATCH] Enable logging before using it Bug #1200530 Change-Id: I086353c93fae0f6ec74d16a485c215c1b3815ee6 --- neutron/common/config.py | 3 --- neutron/db/migration/cli.py | 1 + neutron/service.py | 2 ++ neutron/services/loadbalancer/drivers/haproxy/agent.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/neutron/common/config.py b/neutron/common/config.py index 52ced13f7..3796488d7 100644 --- a/neutron/common/config.py +++ b/neutron/common/config.py @@ -25,7 +25,6 @@ from oslo.config import cfg from paste import deploy from neutron.api.v2 import attributes -from neutron.common import legacy from neutron.common import utils from neutron.openstack.common.db.sqlalchemy import session as db_session from neutron.openstack.common import log as logging @@ -108,8 +107,6 @@ def parse(args): cfg.CONF(args=args, project='neutron', version='%%prog %s' % neutron_version.release_string()) - legacy.modernize_quantum_config(cfg.CONF) - # Validate that the base_mac is of the correct format msg = attributes._validate_regex(cfg.CONF.base_mac, attributes.MAC_PATTERN) diff --git a/neutron/db/migration/cli.py b/neutron/db/migration/cli.py index 7219038ae..759c586e1 100644 --- a/neutron/db/migration/cli.py +++ b/neutron/db/migration/cli.py @@ -135,5 +135,6 @@ def main(): config.neutron_config = CONF CONF() + #TODO(gongysh) enable logging legacy.modernize_quantum_config(CONF) CONF.command.func(config, CONF.command.name) diff --git a/neutron/service.py b/neutron/service.py index cb466fc88..b90510ce5 100644 --- a/neutron/service.py +++ b/neutron/service.py @@ -23,6 +23,7 @@ import random from oslo.config import cfg from neutron.common import config +from neutron.common import legacy from neutron import context from neutron.openstack.common import importutils from neutron.openstack.common import log as logging @@ -80,6 +81,7 @@ class NeutronApiService(WsgiService): # Log the options used when starting if we're in debug mode... config.setup_logging(cfg.CONF) + legacy.modernize_quantum_config(cfg.CONF) # Dump the initial option values cfg.CONF.log_opt_values(LOG, std_logging.DEBUG) service = cls(app_name) diff --git a/neutron/services/loadbalancer/drivers/haproxy/agent.py b/neutron/services/loadbalancer/drivers/haproxy/agent.py index 9ea62b50e..0aa183a99 100644 --- a/neutron/services/loadbalancer/drivers/haproxy/agent.py +++ b/neutron/services/loadbalancer/drivers/haproxy/agent.py @@ -58,8 +58,8 @@ def main(): config.register_root_helper(cfg.CONF) cfg.CONF(project='neutron') - legacy.modernize_quantum_config(cfg.CONF) config.setup_logging(cfg.CONF) + legacy.modernize_quantum_config(cfg.CONF) mgr = manager.LbaasAgentManager(cfg.CONF) svc = LbaasAgentService(