Merge "Removed duplicated function prepare_service()"

This commit is contained in:
Jenkins 2015-12-16 10:41:32 +00:00 committed by Gerrit Code Review
commit d3160bf007
3 changed files with 6 additions and 33 deletions

View File

@ -26,7 +26,7 @@ from oslo_log import log as logging
from watcher._i18n import _
from watcher.api import app as api_app
from watcher import service
from watcher.common import service
LOG = logging.getLogger(__name__)

View File

@ -14,6 +14,7 @@
# License for the specific language governing permissions and limitations
# under the License.
import logging
import signal
import socket
@ -124,9 +125,10 @@ _DEFAULT_LOG_LEVELS = ['amqp=WARN', 'amqplib=WARN', 'qpid.messaging=INFO',
'glanceclient=WARN', 'watcher.openstack.common=WARN']
def prepare_service(argv=[]):
log.register_options(cfg.CONF)
def prepare_service(argv=[], conf=cfg.CONF):
log.register_options(conf)
config.parse_args(argv)
cfg.set_defaults(_options.log_opts,
default_log_levels=_DEFAULT_LOG_LEVELS)
log.setup(cfg.CONF, 'python-watcher')
log.setup(conf, 'python-watcher')
conf.log_opt_values(LOG, logging.DEBUG)

View File

@ -1,29 +0,0 @@
# -*- encoding: utf-8 -*-
# Copyright (c) 2015 b<>com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
from oslo_config import cfg
from oslo_log import log
LOG = log.getLogger(__name__)
def prepare_service(args=None, conf=cfg.CONF):
log.register_options(conf)
log.setup(conf, 'watcher')
conf(args, project='python-watcher')
conf.log_opt_values(LOG, logging.DEBUG)