Migrating to use oslo_log
This commit is contained in:
parent
f33d038fe5
commit
d29348ed2c
@ -20,7 +20,6 @@ import eventlet
|
||||
eventlet.monkey_patch(os=False)
|
||||
|
||||
import os
|
||||
import six
|
||||
import sys
|
||||
|
||||
# If ../senlin/__init__.py exists, add ../ to Python search path, so that
|
||||
@ -33,22 +32,26 @@ if os.path.exists(os.path.join(possible_topdir, 'senlin', '__init__.py')):
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_i18n import _lazy
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
|
||||
from senlin.common import config
|
||||
from senlin.common.i18n import _LI
|
||||
from senlin.common import messaging
|
||||
from senlin.common import wsgi
|
||||
from senlin.openstack.common import log as logging
|
||||
|
||||
from senlin.openstack.common import systemd
|
||||
|
||||
_lazy.enable_lazy()
|
||||
|
||||
LOG = logging.getLogger('senlin.api')
|
||||
LOG = logging.getLogger('senlin_api')
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
logging.register_options(cfg.CONF)
|
||||
cfg.CONF(project='senlin', prog='senlin-api')
|
||||
logging.setup('senlin')
|
||||
logging.setup(cfg.CONF, 'senlin-api')
|
||||
logging.set_defaults()
|
||||
messaging.setup()
|
||||
|
||||
app = config.load_paste_app()
|
||||
|
@ -32,10 +32,10 @@ if os.path.exists(os.path.join(POSSIBLE_TOPDIR, 'senlin', '__init__.py')):
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_i18n import _lazy
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common import consts
|
||||
from senlin.common import messaging
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.openstack.common import service
|
||||
|
||||
_lazy.enable_lazy()
|
||||
@ -43,9 +43,10 @@ _lazy.enable_lazy()
|
||||
LOG = logging.getLogger('senlin.engine')
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
logging.register_options(cfg.CONF)
|
||||
cfg.CONF(project='senlin', prog='senlin-engine')
|
||||
logging.setup('senlin')
|
||||
logging.setup(cfg.CONF, 'senlin-engine')
|
||||
logging.set_defaults()
|
||||
messaging.setup()
|
||||
|
||||
from senlin.engine import service as engine
|
||||
|
@ -30,9 +30,6 @@ from senlin.common import serializers
|
||||
from senlin.common import wsgi
|
||||
|
||||
|
||||
cfg.CONF.import_opt('debug', 'senlin.openstack.common.log')
|
||||
|
||||
|
||||
class Fault(object):
|
||||
|
||||
def __init__(self, error):
|
||||
|
@ -18,12 +18,11 @@ return
|
||||
"""
|
||||
|
||||
import re
|
||||
|
||||
import webob
|
||||
|
||||
from senlin.common import wsgi
|
||||
from senlin.openstack.common import log as logging
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common import wsgi
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -13,12 +13,13 @@
|
||||
|
||||
from webob import exc
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.api.openstack.v1 import util
|
||||
from senlin.common import consts
|
||||
from senlin.common.i18n import _
|
||||
from senlin.common import serializers
|
||||
from senlin.common import wsgi
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.rpc import client as rpc_client
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -18,13 +18,13 @@ Cluster endpoint for Senlin v1 ReST API.
|
||||
from webob import exc
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.api.openstack.v1 import util
|
||||
from senlin.common import consts
|
||||
from senlin.common.i18n import _
|
||||
from senlin.common import serializers
|
||||
from senlin.common import wsgi
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.rpc import client as rpc_client
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -16,12 +16,13 @@ Node endpoint for Senlin v1 ReST API.
|
||||
|
||||
from webob import exc
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.api.openstack.v1 import util
|
||||
from senlin.common import consts
|
||||
from senlin.common.i18n import _
|
||||
from senlin.common import serializers
|
||||
from senlin.common import wsgi
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.rpc import client as rpc_client
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -16,10 +16,11 @@ Policy type endpoint for Senlin v1 ReST API.
|
||||
|
||||
from webob import exc
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.api.openstack.v1 import util
|
||||
from senlin.common import serializers
|
||||
from senlin.common import wsgi
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.rpc import client as rpc_client
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -17,14 +17,13 @@ CLI interface for senlin management.
|
||||
import sys
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common.i18n import _
|
||||
from senlin.db import api
|
||||
from senlin.db import utils
|
||||
from senlin.openstack.common import log
|
||||
from senlin import version
|
||||
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
@ -71,13 +70,15 @@ command_opt = cfg.SubCommandOpt('command',
|
||||
|
||||
|
||||
def main():
|
||||
logging.register_options(CONF)
|
||||
logging.setup(CONF, 'senlin-manage')
|
||||
CONF.register_cli_opt(command_opt)
|
||||
|
||||
try:
|
||||
default_config_files = cfg.find_config_files('senlin', 'senlin-engine')
|
||||
CONF(sys.argv[1:], project='senlin', prog='senlin-manage',
|
||||
version=version.version_info.version_string(),
|
||||
default_config_files=default_config_files)
|
||||
log.setup("senlin")
|
||||
except RuntimeError as e:
|
||||
sys.exit("ERROR: %s" % e)
|
||||
|
||||
|
@ -19,10 +19,10 @@ import os
|
||||
import socket
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common.i18n import _
|
||||
from senlin.common import wsgi
|
||||
from senlin.openstack.common import log as logging
|
||||
|
||||
paste_deploy_group = cfg.OptGroup('paste_deploy')
|
||||
paste_deploy_opts = [
|
||||
|
@ -11,6 +11,7 @@
|
||||
# under the License.
|
||||
|
||||
from oslo_context import context
|
||||
from oslo_log import log as logging
|
||||
from oslo_middleware import request_id as oslo_request_id
|
||||
from oslo_utils import importutils
|
||||
|
||||
@ -18,7 +19,6 @@ from senlin.common import exception
|
||||
from senlin.common import policy
|
||||
from senlin.common import wsgi
|
||||
from senlin.db import api as db_api
|
||||
from senlin.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -19,12 +19,12 @@
|
||||
import functools
|
||||
import sys
|
||||
|
||||
from oslo_log import log as logging
|
||||
import six
|
||||
from six.moves.urllib import parse as urlparse
|
||||
|
||||
from senlin.common.i18n import _
|
||||
from senlin.common.i18n import _LE
|
||||
from senlin.openstack.common import log as logging
|
||||
|
||||
|
||||
_FATAL_EXCEPTION_FORMAT_ERRORS = False
|
||||
|
@ -14,11 +14,11 @@ import collections
|
||||
import numbers
|
||||
import six
|
||||
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import strutils
|
||||
|
||||
from senlin.common import exception
|
||||
from senlin.common.i18n import _
|
||||
from senlin.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -17,7 +17,7 @@ Utility methods for serializing responses
|
||||
import datetime
|
||||
import json
|
||||
|
||||
from senlin.openstack.common import log as logging
|
||||
from oslo_log import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -22,12 +22,12 @@ from six.moves import urllib
|
||||
import uuid
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
from oslo_utils import strutils
|
||||
|
||||
from senlin.common import exception
|
||||
from senlin.common.i18n import _
|
||||
from senlin.common.i18n import _LI
|
||||
from senlin.openstack.common import log as logging
|
||||
|
||||
cfg.CONF.import_opt('max_response_size', 'senlin.common.config')
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -82,9 +82,6 @@ cfg.CONF.register_group(api_group)
|
||||
cfg.CONF.register_opts(api_opts,
|
||||
group=api_group)
|
||||
|
||||
cfg.CONF.import_opt('debug', 'senlin.openstack.common.log')
|
||||
cfg.CONF.import_opt('verbose', 'senlin.openstack.common.log')
|
||||
|
||||
json_size_opt = cfg.IntOpt('max_json_body_size',
|
||||
default=1048576,
|
||||
help='Maximum raw byte size of JSON request body.'
|
||||
|
@ -20,6 +20,7 @@ import sys
|
||||
from oslo_config import cfg
|
||||
from oslo_db.sqlalchemy import session as db_session
|
||||
from oslo_db.sqlalchemy import utils
|
||||
from oslo_log import log as logging
|
||||
from sqlalchemy.orm import session as orm_session
|
||||
from sqlalchemy import exc
|
||||
|
||||
@ -29,7 +30,6 @@ from senlin.common.i18n import _
|
||||
from senlin.db.sqlalchemy import filters as db_filters
|
||||
from senlin.db.sqlalchemy import migration
|
||||
from senlin.db.sqlalchemy import models
|
||||
from senlin.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -15,13 +15,13 @@ import six
|
||||
import time
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common import context as req_context
|
||||
from senlin.common import exception
|
||||
from senlin.common.i18n import _
|
||||
from senlin.common.i18n import _LI
|
||||
from senlin.db import api as db_api
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.policies import base as policy_mod
|
||||
|
||||
wallclock = time.time
|
||||
|
@ -12,6 +12,8 @@
|
||||
|
||||
import random
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common import consts
|
||||
from senlin.common import exception
|
||||
from senlin.common.i18n import _
|
||||
@ -23,7 +25,6 @@ from senlin.engine import dispatcher
|
||||
from senlin.engine import node as node_mod
|
||||
from senlin.engine import scheduler
|
||||
from senlin.engine import senlin_lock
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.policies import base as policy_mod
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -10,8 +10,9 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.engine.actions import base
|
||||
from senlin.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -10,12 +10,13 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common import exception
|
||||
from senlin.common.i18n import _LE
|
||||
from senlin.engine.actions import base
|
||||
from senlin.engine import node as node_mod
|
||||
from senlin.engine import senlin_lock
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.policies import base as policy_mod
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -12,10 +12,11 @@
|
||||
|
||||
import datetime
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common import exception
|
||||
from senlin.db import api as db_api
|
||||
from senlin.engine.actions import base
|
||||
from senlin.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
import datetime
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common import exception
|
||||
from senlin.common.i18n import _LE
|
||||
@ -20,7 +21,6 @@ from senlin.common.i18n import _LW
|
||||
from senlin.db import api as db_api
|
||||
from senlin.engine import event as events
|
||||
from senlin.engine import node as node_mod
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.openstack.common import periodic_task
|
||||
from senlin.profiles import base as profiles_base
|
||||
|
||||
|
@ -11,13 +11,13 @@
|
||||
# under the License.
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
import oslo_messaging
|
||||
from osprofiler import profiler
|
||||
|
||||
from senlin.common import consts
|
||||
from senlin.common.i18n import _LI
|
||||
from senlin.common import messaging as rpc_messaging
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.openstack.common import service
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -16,6 +16,7 @@ import six
|
||||
from stevedore import extension
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common import exception
|
||||
from senlin.common.i18n import _
|
||||
@ -23,10 +24,8 @@ from senlin.common.i18n import _LE
|
||||
from senlin.common.i18n import _LI
|
||||
from senlin.engine import parser
|
||||
from senlin.engine import registry
|
||||
from senlin.openstack.common import log
|
||||
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
_environment = None
|
||||
|
||||
|
@ -12,9 +12,10 @@
|
||||
|
||||
import datetime
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common import i18n
|
||||
from senlin.db import api as db_api
|
||||
from senlin.openstack.common import log
|
||||
|
||||
_LC = i18n._LC
|
||||
_LE = i18n._LE
|
||||
@ -22,7 +23,7 @@ _LW = i18n._LW
|
||||
_LI = i18n._LI
|
||||
_ = i18n._
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
class_mapping = {
|
||||
'senlin.engine.cluster.Cluster': 'CLUSTER',
|
||||
|
@ -12,12 +12,13 @@
|
||||
|
||||
import datetime
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common import exception
|
||||
from senlin.common.i18n import _LE
|
||||
from senlin.common.i18n import _LW
|
||||
from senlin.db import api as db_api
|
||||
from senlin.engine import event as events
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.profiles import base as profile_base
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -17,9 +17,10 @@ import six
|
||||
from six.moves import urllib
|
||||
import yaml
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common.i18n import _
|
||||
from senlin.common.i18n import _LE
|
||||
from senlin.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -13,11 +13,12 @@
|
||||
import itertools
|
||||
import six
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common.i18n import _LI
|
||||
from senlin.common.i18n import _LW
|
||||
from senlin.openstack.common import log
|
||||
|
||||
LOG = log.getLogger(__name__)
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class PluginInfo(object):
|
||||
|
@ -14,10 +14,10 @@ import eventlet
|
||||
import time
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.engine.actions import base as action_mod
|
||||
from senlin.engine import dispatcher
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.openstack.common import threadgroup
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -1,20 +1,20 @@
|
||||
#
|
||||
# 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
|
||||
# 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.
|
||||
# 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 contextlib
|
||||
import uuid
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
import oslo_messaging
|
||||
from oslo_utils import excutils
|
||||
|
||||
@ -25,7 +25,6 @@ from senlin.common.i18n import _LW
|
||||
from senlin.common import messaging as rpc_messaging
|
||||
from senlin.db import api as db_api
|
||||
from senlin.engine import scheduler
|
||||
from senlin.openstack.common import log as logging
|
||||
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
@ -13,8 +13,9 @@
|
||||
import functools
|
||||
import random
|
||||
|
||||
from oslo import messaging
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
import oslo_messaging
|
||||
from oslo_utils import uuidutils
|
||||
from osprofiler import profiler
|
||||
|
||||
@ -33,7 +34,6 @@ from senlin.engine import environment
|
||||
from senlin.engine import node as node_mod
|
||||
from senlin.engine import scheduler
|
||||
from senlin.engine import senlin_lock
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.openstack.common import service
|
||||
from senlin.policies import base as policy_base
|
||||
from senlin.profiles import base as profile_base
|
||||
@ -66,7 +66,7 @@ def request_context(func):
|
||||
try:
|
||||
return func(self, ctx, *args, **kwargs)
|
||||
except exception.SenlinException:
|
||||
raise messaging.rpc.dispatcher.ExpectedException()
|
||||
raise oslo_messaging.rpc.dispatcher.ExpectedException()
|
||||
return wrapped
|
||||
|
||||
|
||||
@ -137,9 +137,9 @@ class EngineService(service.Service):
|
||||
|
||||
self.dispatcher.start()
|
||||
|
||||
target = messaging.Target(version=consts.RPC_API_VERSION,
|
||||
server=self.host,
|
||||
topic=self.topic)
|
||||
target = oslo_messaging.Target(version=consts.RPC_API_VERSION,
|
||||
server=self.host,
|
||||
topic=self.topic)
|
||||
self.target = target
|
||||
server = rpc_messaging.get_rpc_server(target, self)
|
||||
server.start()
|
||||
|
@ -10,13 +10,14 @@
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common import constraints
|
||||
from senlin.common import consts
|
||||
from senlin.common.i18n import _
|
||||
from senlin.common.i18n import _LW
|
||||
from senlin.common import schema
|
||||
from senlin.db import api as db_api
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.policies import base
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -12,12 +12,12 @@
|
||||
|
||||
import datetime
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common import exception
|
||||
from senlin.common import schema
|
||||
from senlin.db import api as db_api
|
||||
from senlin.engine import environment
|
||||
from senlin.openstack.common import log as logging
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -12,13 +12,14 @@
|
||||
|
||||
import six
|
||||
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common import context
|
||||
from senlin.common import exception
|
||||
from senlin.common.i18n import _
|
||||
from senlin.common import schema
|
||||
from senlin.drivers import heat_v1 as heatclient
|
||||
from senlin.engine import scheduler
|
||||
from senlin.openstack.common import log as logging
|
||||
from senlin.profiles import base
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
@ -15,10 +15,10 @@ Client side of the senlin engine RPC API.
|
||||
'''
|
||||
|
||||
from oslo_config import cfg
|
||||
from oslo_log import log as logging
|
||||
|
||||
from senlin.common import consts
|
||||
from senlin.common import messaging
|
||||
from senlin.openstack.common import log as logging
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
@ -33,7 +33,6 @@ oslo.config.opts =
|
||||
senlin.common.wsgi = senlin.common.wsgi:list_opts
|
||||
senlin.engine.notification = senlin.engine.notification:list_opts
|
||||
senlin.openstack.common.eventlet_backdoor = senlin.openstack.common.eventlet_backdoor:list_opts
|
||||
senlin.openstack.common.log = senlin.openstack.common.log:list_opts
|
||||
senlin.openstack.common.policy = senlin.openstack.common.policy:list_opts
|
||||
|
||||
senlin.profiles =
|
||||
|
Loading…
Reference in New Issue
Block a user