Merge "Use openstack common log to do logging."
This commit is contained in:
commit
830823439b
@ -1,23 +1,29 @@
|
|||||||
[DEFAULT]
|
[DEFAULT]
|
||||||
# Default log level is WARNING
|
# Default log level is INFO
|
||||||
# Show debugging output in logs (sets DEBUG log level output)
|
# verbose and debug has the same result.
|
||||||
|
# One of them will set DEBUG log level output
|
||||||
# debug = False
|
# debug = False
|
||||||
|
|
||||||
# Show more verbose log output (sets INFO log level output) if debug is False
|
|
||||||
# verbose = False
|
# verbose = False
|
||||||
|
|
||||||
# log_format = %(asctime)s %(levelname)8s [%(name)s] %(message)s
|
# log_format = %(asctime)s %(levelname)8s [%(name)s] %(message)s
|
||||||
# log_date_format = %Y-%m-%d %H:%M:%S
|
# log_date_format = %Y-%m-%d %H:%M:%S
|
||||||
|
|
||||||
|
# use_syslog -> syslog
|
||||||
|
# log_file and log_dir -> log_dir/log_file
|
||||||
|
# (not log_file) and log_dir -> log_dir/{binary_name}.log
|
||||||
|
# use_stderr -> stderr
|
||||||
|
# (not user_stderr) and (not log_file) -> stdout
|
||||||
|
# publish_errors -> notification system
|
||||||
|
|
||||||
# use_syslog = False
|
# use_syslog = False
|
||||||
# syslog_log_facility = LOG_USER
|
# syslog_log_facility = LOG_USER
|
||||||
|
|
||||||
# if use_syslog is False, we can set log_file and log_dir.
|
# use_stderr = True
|
||||||
# if use_syslog is False and we do not set log_file,
|
|
||||||
# the log will be printed to stdout.
|
|
||||||
# log_file =
|
# log_file =
|
||||||
# log_dir =
|
# log_dir =
|
||||||
|
|
||||||
|
# publish_errors = False
|
||||||
|
|
||||||
# Address to bind the API server
|
# Address to bind the API server
|
||||||
bind_host = 0.0.0.0
|
bind_host = 0.0.0.0
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
@ -37,6 +36,7 @@ from quantum.openstack.common import cfg
|
|||||||
from quantum.openstack.common import context
|
from quantum.openstack.common import context
|
||||||
from quantum.openstack.common import importutils
|
from quantum.openstack.common import importutils
|
||||||
from quantum.openstack.common import jsonutils
|
from quantum.openstack.common import jsonutils
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum.openstack.common.rpc import proxy
|
from quantum.openstack.common.rpc import proxy
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
#
|
#
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@ -33,6 +32,7 @@ from quantum.agent.linux import utils
|
|||||||
from quantum.db import l3_db
|
from quantum.db import l3_db
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
from quantum.openstack.common import importutils
|
from quantum.openstack.common import importutils
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantumclient.v2_0 import client
|
from quantumclient.v2_0 import client
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import socket
|
import socket
|
||||||
@ -30,6 +29,7 @@ from quantum.agent.linux import ip_lib
|
|||||||
from quantum.agent.linux import utils
|
from quantum.agent.linux import utils
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
from quantum.openstack.common import jsonutils
|
from quantum.openstack.common import jsonutils
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
import logging
|
|
||||||
|
|
||||||
import netaddr
|
import netaddr
|
||||||
|
|
||||||
@ -27,6 +26,7 @@ from quantum.common import exceptions
|
|||||||
from quantum.extensions.flavor import (FLAVOR_NETWORK)
|
from quantum.extensions.flavor import (FLAVOR_NETWORK)
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
from quantum.openstack.common import importutils
|
from quantum.openstack.common import importutils
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -22,10 +22,10 @@
|
|||||||
"""Implements iptables rules using linux utilities."""
|
"""Implements iptables rules using linux utilities."""
|
||||||
|
|
||||||
import inspect
|
import inspect
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from quantum.agent.linux import utils
|
from quantum.agent.linux import utils
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
# NOTE(vish): Iptables supports chain names of up to 28 characters, and we
|
# NOTE(vish): Iptables supports chain names of up to 28 characters, and we
|
||||||
|
@ -18,10 +18,10 @@
|
|||||||
# @author: Dan Wendlandt, Nicira Networks, Inc.
|
# @author: Dan Wendlandt, Nicira Networks, Inc.
|
||||||
# @author: Dave Lapsley, Nicira Networks, Inc.
|
# @author: Dave Lapsley, Nicira Networks, Inc.
|
||||||
|
|
||||||
import logging
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from quantum.agent.linux import utils
|
from quantum.agent.linux import utils
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
# @author: Juliano Martinez, Locaweb.
|
# @author: Juliano Martinez, Locaweb.
|
||||||
|
|
||||||
import fcntl
|
import fcntl
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import shlex
|
import shlex
|
||||||
import signal
|
import signal
|
||||||
@ -28,7 +27,7 @@ import struct
|
|||||||
from eventlet.green import subprocess
|
from eventlet.green import subprocess
|
||||||
|
|
||||||
from quantum.common import utils
|
from quantum.common import utils
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
import logging
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -13,6 +12,7 @@ from quantum.api.v2 import attributes
|
|||||||
from quantum.common import config
|
from quantum.common import config
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
from quantum.openstack.common import importutils
|
from quantum.openstack.common import importutils
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
NS_MANGLING_PATTERN = ('(%s|%s)' % (dhcp_agent.NS_PREFIX, l3_agent.NS_PREFIX) +
|
NS_MANGLING_PATTERN = ('(%s|%s)' % (dhcp_agent.NS_PREFIX, l3_agent.NS_PREFIX) +
|
||||||
|
@ -13,12 +13,11 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
import eventlet
|
import eventlet
|
||||||
|
|
||||||
from quantum.common import topics
|
from quantum.common import topics
|
||||||
|
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum.openstack.common import rpc
|
from quantum.openstack.common import rpc
|
||||||
from quantum.openstack.common.rpc import proxy
|
from quantum.openstack.common.rpc import proxy
|
||||||
from quantum.openstack.common.notifier import api
|
from quantum.openstack.common.notifier import api
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from webob import exc
|
from webob import exc
|
||||||
|
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -17,12 +17,11 @@ ATTR_NOT_SPECIFIED = object()
|
|||||||
# Defining a constant to avoid repeating string literal in several modules
|
# Defining a constant to avoid repeating string literal in several modules
|
||||||
SHARED = 'shared'
|
SHARED = 'shared'
|
||||||
|
|
||||||
import logging
|
|
||||||
import netaddr
|
import netaddr
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from quantum.common import exceptions as q_exc
|
from quantum.common import exceptions as q_exc
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
import socket
|
import socket
|
||||||
|
|
||||||
import webob.exc
|
import webob.exc
|
||||||
@ -22,6 +21,7 @@ from quantum.api.v2 import attributes
|
|||||||
from quantum.api.v2 import resource as wsgi_resource
|
from quantum.api.v2 import resource as wsgi_resource
|
||||||
from quantum.common import exceptions
|
from quantum.common import exceptions
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum.openstack.common.notifier import api as notifier_api
|
from quantum.openstack.common.notifier import api as notifier_api
|
||||||
from quantum import policy
|
from quantum import policy
|
||||||
from quantum import quota
|
from quantum import quota
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
"""
|
"""
|
||||||
Utility methods for working with WSGI servers redux
|
Utility methods for working with WSGI servers redux
|
||||||
"""
|
"""
|
||||||
import logging
|
|
||||||
|
|
||||||
import webob
|
import webob
|
||||||
import webob.dec
|
import webob.dec
|
||||||
@ -25,6 +24,7 @@ import webob.exc
|
|||||||
from quantum.common import exceptions
|
from quantum.common import exceptions
|
||||||
from quantum import context
|
from quantum import context
|
||||||
from quantum.openstack.common import jsonutils as json
|
from quantum.openstack.common import jsonutils as json
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum import wsgi
|
from quantum import wsgi
|
||||||
|
|
||||||
|
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
import urlparse
|
import urlparse
|
||||||
|
|
||||||
import routes as routes_mapper
|
import routes as routes_mapper
|
||||||
@ -26,6 +25,7 @@ from quantum.api.v2 import base
|
|||||||
from quantum.extensions import extensions
|
from quantum.extensions import extensions
|
||||||
from quantum import manager
|
from quantum import manager
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum import wsgi
|
from quantum import wsgi
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,10 +15,10 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
import webob.dec
|
import webob.dec
|
||||||
|
|
||||||
from quantum.api.views import versions as versions_view
|
from quantum.api.views import versions as versions_view
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum import wsgi
|
from quantum import wsgi
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,15 +14,13 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
import webob.dec
|
import webob.dec
|
||||||
import webob.exc
|
import webob.exc
|
||||||
|
|
||||||
from quantum import context
|
from quantum import context
|
||||||
from quantum import wsgi
|
from quantum import wsgi
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -19,9 +19,6 @@
|
|||||||
Routines for configuring Quantum
|
Routines for configuring Quantum
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
|
||||||
import logging.config
|
|
||||||
import logging.handlers
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -29,9 +26,9 @@ from paste import deploy
|
|||||||
|
|
||||||
from quantum.api.v2 import attributes
|
from quantum.api.v2 import attributes
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum.version import version_string
|
from quantum.version import version_string
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
core_opts = [
|
core_opts = [
|
||||||
@ -79,45 +76,10 @@ def setup_logging(conf):
|
|||||||
|
|
||||||
:param conf: a cfg.ConfOpts object
|
:param conf: a cfg.ConfOpts object
|
||||||
"""
|
"""
|
||||||
|
product_name = "quantum"
|
||||||
if conf.log_config:
|
logging.setup(product_name)
|
||||||
# Use a logging configuration file for all settings...
|
log_root = logging.getLogger(product_name).logger
|
||||||
if os.path.exists(conf.log_config):
|
log_root.propagate = 0
|
||||||
logging.config.fileConfig(conf.log_config)
|
|
||||||
return
|
|
||||||
else:
|
|
||||||
raise RuntimeError("Unable to locate specified logging "
|
|
||||||
"config file: %s" % conf.log_config)
|
|
||||||
|
|
||||||
root_logger = logging.root
|
|
||||||
if conf.debug:
|
|
||||||
root_logger.setLevel(logging.DEBUG)
|
|
||||||
elif conf.verbose:
|
|
||||||
root_logger.setLevel(logging.INFO)
|
|
||||||
else:
|
|
||||||
root_logger.setLevel(logging.WARNING)
|
|
||||||
|
|
||||||
formatter = logging.Formatter(conf.log_format, conf.log_date_format)
|
|
||||||
|
|
||||||
if conf.use_syslog:
|
|
||||||
try:
|
|
||||||
facility = getattr(logging.handlers.SysLogHandler,
|
|
||||||
conf.syslog_log_facility)
|
|
||||||
except AttributeError:
|
|
||||||
raise ValueError(_("Invalid syslog facility"))
|
|
||||||
|
|
||||||
handler = logging.handlers.SysLogHandler(address='/dev/log',
|
|
||||||
facility=facility)
|
|
||||||
elif conf.log_file:
|
|
||||||
logfile = conf.log_file
|
|
||||||
if conf.log_dir:
|
|
||||||
logfile = os.path.join(conf.log_dir, logfile)
|
|
||||||
handler = logging.handlers.WatchedFileHandler(logfile)
|
|
||||||
else:
|
|
||||||
handler = logging.StreamHandler(sys.stdout)
|
|
||||||
|
|
||||||
handler.setFormatter(formatter)
|
|
||||||
root_logger.addHandler(handler)
|
|
||||||
LOG.info("Logging enabled!")
|
LOG.info("Logging enabled!")
|
||||||
|
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
"""Utilities and helper functions."""
|
"""Utilities and helper functions."""
|
||||||
|
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import signal
|
import signal
|
||||||
import uuid
|
import uuid
|
||||||
@ -29,8 +28,10 @@ import uuid
|
|||||||
from eventlet.green import subprocess
|
from eventlet.green import subprocess
|
||||||
|
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
|
TIME_FORMAT = "%Y-%m-%dT%H:%M:%SZ"
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def boolize(subject):
|
def boolize(subject):
|
||||||
@ -60,7 +61,7 @@ def read_cached_file(filename, cache_info, reload_func=None):
|
|||||||
"""
|
"""
|
||||||
mtime = os.path.getmtime(filename)
|
mtime = os.path.getmtime(filename)
|
||||||
if not cache_info or mtime != cache_info.get('mtime'):
|
if not cache_info or mtime != cache_info.get('mtime'):
|
||||||
logging.debug(_("Reloading cached file %s") % filename)
|
LOG.debug(_("Reloading cached file %s") % filename)
|
||||||
with open(filename) as fap:
|
with open(filename) as fap:
|
||||||
cache_info['data'] = fap.read()
|
cache_info['data'] = fap.read()
|
||||||
cache_info['mtime'] = mtime
|
cache_info['mtime'] = mtime
|
||||||
|
@ -18,12 +18,14 @@
|
|||||||
"""Context: context for security/db session."""
|
"""Context: context for security/db session."""
|
||||||
|
|
||||||
import copy
|
import copy
|
||||||
import logging
|
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from quantum.db import api as db_api
|
from quantum.db import api as db_api
|
||||||
from quantum.openstack.common import context as common_context
|
from quantum.openstack.common import context as common_context
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
# @author: Brad Hall, Nicira Networks, Inc.
|
# @author: Brad Hall, Nicira Networks, Inc.
|
||||||
# @author: Dan Wendlandt, Nicira Networks, Inc.
|
# @author: Dan Wendlandt, Nicira Networks, Inc.
|
||||||
|
|
||||||
import logging
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import sqlalchemy as sql
|
import sqlalchemy as sql
|
||||||
@ -26,6 +25,7 @@ from sqlalchemy.exc import DisconnectionError
|
|||||||
from sqlalchemy.orm import sessionmaker, exc
|
from sqlalchemy.orm import sessionmaker, exc
|
||||||
|
|
||||||
from quantum.db import model_base
|
from quantum.db import model_base
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import logging
|
|
||||||
import random
|
import random
|
||||||
|
|
||||||
import netaddr
|
import netaddr
|
||||||
@ -28,6 +27,7 @@ from quantum.common import utils
|
|||||||
from quantum.db import api as db
|
from quantum.db import api as db
|
||||||
from quantum.db import models_v2
|
from quantum.db import models_v2
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum.openstack.common import timeutils
|
from quantum.openstack.common import timeutils
|
||||||
from quantum import quantum_plugin_base_v2
|
from quantum import quantum_plugin_base_v2
|
||||||
|
|
||||||
|
@ -13,14 +13,13 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from sqlalchemy.orm import exc
|
from sqlalchemy.orm import exc
|
||||||
|
|
||||||
from quantum import context as quantum_context
|
from quantum import context as quantum_context
|
||||||
from quantum import manager
|
from quantum import manager
|
||||||
from quantum.api.v2 import attributes
|
from quantum.api.v2 import attributes
|
||||||
from quantum.openstack.common import context
|
from quantum.openstack.common import context
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
@ -19,8 +19,6 @@
|
|||||||
#
|
#
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
import netaddr
|
import netaddr
|
||||||
import sqlalchemy as sa
|
import sqlalchemy as sa
|
||||||
from sqlalchemy import orm
|
from sqlalchemy import orm
|
||||||
@ -36,6 +34,8 @@ from quantum.db import model_base
|
|||||||
from quantum.db import models_v2
|
from quantum.db import models_v2
|
||||||
from quantum.extensions import l3
|
from quantum.extensions import l3
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
from quantum import policy
|
from quantum import policy
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
from abc import ABCMeta
|
from abc import ABCMeta
|
||||||
import imp
|
import imp
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
import routes
|
import routes
|
||||||
@ -31,6 +30,7 @@ import quantum.extensions
|
|||||||
from quantum.manager import QuantumManager
|
from quantum.manager import QuantumManager
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
from quantum.openstack.common import importutils
|
from quantum.openstack.common import importutils
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum import wsgi
|
from quantum import wsgi
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,9 +15,8 @@
|
|||||||
# under the License.
|
# under the License.
|
||||||
#
|
#
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from quantum.api.v2 import attributes
|
from quantum.api.v2 import attributes
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -23,11 +23,10 @@ class.
|
|||||||
The caller should make sure that QuantumManager is a singleton.
|
The caller should make sure that QuantumManager is a singleton.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from quantum.common.exceptions import ClassNotFound
|
from quantum.common.exceptions import ClassNotFound
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
from quantum.openstack.common import importutils
|
from quantum.openstack.common import importutils
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
# Quantum OpenVSwitch Plugin.
|
# Quantum OpenVSwitch Plugin.
|
||||||
# @author: Sumit Naiksatam, Cisco Systems, Inc.
|
# @author: Sumit Naiksatam, Cisco Systems, Inc.
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
@ -38,12 +37,13 @@ from quantum.common import constants
|
|||||||
from quantum.common import topics
|
from quantum.common import topics
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
from quantum.openstack.common import context
|
from quantum.openstack.common import context
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum.openstack.common import rpc
|
from quantum.openstack.common import rpc
|
||||||
from quantum.openstack.common.rpc import dispatcher
|
from quantum.openstack.common.rpc import dispatcher
|
||||||
from quantum.plugins.linuxbridge.common import config
|
from quantum.plugins.linuxbridge.common import config
|
||||||
from quantum.plugins.linuxbridge.common import constants as lconst
|
from quantum.plugins.linuxbridge.common import constants as lconst
|
||||||
|
|
||||||
logging.basicConfig()
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
BRIDGE_NAME_PREFIX = "brq"
|
BRIDGE_NAME_PREFIX = "brq"
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from sqlalchemy.orm import exc
|
from sqlalchemy.orm import exc
|
||||||
|
|
||||||
@ -21,6 +20,7 @@ from quantum.common import exceptions as q_exc
|
|||||||
import quantum.db.api as db
|
import quantum.db.api as db
|
||||||
from quantum.db import models_v2
|
from quantum.db import models_v2
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum.plugins.linuxbridge.common import config
|
from quantum.plugins.linuxbridge.common import config
|
||||||
from quantum.plugins.linuxbridge.common import constants
|
from quantum.plugins.linuxbridge.common import constants
|
||||||
from quantum.plugins.linuxbridge.db import l2network_models_v2
|
from quantum.plugins.linuxbridge.db import l2network_models_v2
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from quantum.api.v2 import attributes
|
from quantum.api.v2 import attributes
|
||||||
@ -28,6 +27,7 @@ from quantum.db import models_v2
|
|||||||
from quantum.extensions import providernet as provider
|
from quantum.extensions import providernet as provider
|
||||||
from quantum.openstack.common import context
|
from quantum.openstack.common import context
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum.openstack.common import rpc
|
from quantum.openstack.common import rpc
|
||||||
from quantum.openstack.common.rpc import dispatcher
|
from quantum.openstack.common.rpc import dispatcher
|
||||||
from quantum.openstack.common.rpc import proxy
|
from quantum.openstack.common.rpc import proxy
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
# @author: Dave Lapsley, Nicira Networks, Inc.
|
# @author: Dave Lapsley, Nicira Networks, Inc.
|
||||||
# @author: Aaron Rosen, Nicira Networks, Inc.
|
# @author: Aaron Rosen, Nicira Networks, Inc.
|
||||||
|
|
||||||
import logging
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
@ -35,12 +34,13 @@ from quantum.common import config as logging_config
|
|||||||
from quantum.common import topics
|
from quantum.common import topics
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
from quantum.openstack.common import context
|
from quantum.openstack.common import context
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum.openstack.common import rpc
|
from quantum.openstack.common import rpc
|
||||||
from quantum.openstack.common.rpc import dispatcher
|
from quantum.openstack.common.rpc import dispatcher
|
||||||
from quantum.plugins.openvswitch.common import config
|
from quantum.plugins.openvswitch.common import config
|
||||||
from quantum.plugins.openvswitch.common import constants
|
from quantum.plugins.openvswitch.common import constants
|
||||||
|
|
||||||
logging.basicConfig()
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
# A placeholder for dead vlans.
|
# A placeholder for dead vlans.
|
||||||
@ -687,8 +687,6 @@ def create_agent_config_map(config):
|
|||||||
def main():
|
def main():
|
||||||
eventlet.monkey_patch()
|
eventlet.monkey_patch()
|
||||||
cfg.CONF(args=sys.argv, project='quantum')
|
cfg.CONF(args=sys.argv, project='quantum')
|
||||||
|
|
||||||
# (TODO) gary - swap with common logging
|
|
||||||
logging_config.setup_logging(cfg.CONF)
|
logging_config.setup_logging(cfg.CONF)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
@ -16,14 +16,13 @@
|
|||||||
# @author: Aaron Rosen, Nicira Networks, Inc.
|
# @author: Aaron Rosen, Nicira Networks, Inc.
|
||||||
# @author: Bob Kukura, Red Hat, Inc.
|
# @author: Bob Kukura, Red Hat, Inc.
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from sqlalchemy.orm import exc
|
from sqlalchemy.orm import exc
|
||||||
|
|
||||||
from quantum.common import exceptions as q_exc
|
from quantum.common import exceptions as q_exc
|
||||||
from quantum.db import models_v2
|
from quantum.db import models_v2
|
||||||
import quantum.db.api as db
|
import quantum.db.api as db
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum.plugins.openvswitch.common import constants
|
from quantum.plugins.openvswitch.common import constants
|
||||||
from quantum.plugins.openvswitch import ovs_models_v2
|
from quantum.plugins.openvswitch import ovs_models_v2
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
# @author: Aaron Rosen, Nicira Networks, Inc.
|
# @author: Aaron Rosen, Nicira Networks, Inc.
|
||||||
# @author: Bob Kukura, Red Hat, Inc.
|
# @author: Bob Kukura, Red Hat, Inc.
|
||||||
|
|
||||||
import logging
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
@ -34,6 +33,7 @@ from quantum.db import l3_db
|
|||||||
from quantum.extensions import providernet as provider
|
from quantum.extensions import providernet as provider
|
||||||
from quantum.openstack.common import context
|
from quantum.openstack.common import context
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum.openstack.common import rpc
|
from quantum.openstack.common import rpc
|
||||||
from quantum.openstack.common.rpc import dispatcher
|
from quantum.openstack.common.rpc import dispatcher
|
||||||
from quantum.openstack.common.rpc import proxy
|
from quantum.openstack.common.rpc import proxy
|
||||||
|
@ -18,12 +18,12 @@
|
|||||||
"""
|
"""
|
||||||
Policy engine for quantum. Largely copied from nova.
|
Policy engine for quantum. Largely copied from nova.
|
||||||
"""
|
"""
|
||||||
import logging
|
|
||||||
|
|
||||||
from quantum.api.v2 import attributes
|
from quantum.api.v2 import attributes
|
||||||
from quantum.common import exceptions
|
from quantum.common import exceptions
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
import quantum.common.utils as utils
|
import quantum.common.utils as utils
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum.openstack.common import policy
|
from quantum.openstack.common import policy
|
||||||
|
|
||||||
|
|
||||||
|
@ -16,11 +16,10 @@
|
|||||||
|
|
||||||
"""Quotas for instances, volumes, and floating ips."""
|
"""Quotas for instances, volumes, and floating ips."""
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from quantum.common import exceptions
|
from quantum.common import exceptions
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
from quantum.openstack.common import importutils
|
from quantum.openstack.common import importutils
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
quota_opts = [
|
quota_opts = [
|
||||||
|
@ -15,10 +15,9 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from quantum.common import config
|
from quantum.common import config
|
||||||
from quantum.openstack.common import cfg
|
from quantum.openstack.common import cfg
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
from quantum import wsgi
|
from quantum import wsgi
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,8 +18,6 @@
|
|||||||
"""
|
"""
|
||||||
Utility methods for working with WSGI servers
|
Utility methods for working with WSGI servers
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import logging
|
|
||||||
import sys
|
import sys
|
||||||
from xml.dom import minidom
|
from xml.dom import minidom
|
||||||
from xml.parsers import expat
|
from xml.parsers import expat
|
||||||
@ -34,22 +32,11 @@ import webob.exc
|
|||||||
from quantum.common import exceptions as exception
|
from quantum.common import exceptions as exception
|
||||||
from quantum import context
|
from quantum import context
|
||||||
from quantum.openstack.common import jsonutils
|
from quantum.openstack.common import jsonutils
|
||||||
|
from quantum.openstack.common import log as logging
|
||||||
|
|
||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class WritableLogger(object):
|
|
||||||
"""A thin wrapper that responds to `write` and logs."""
|
|
||||||
|
|
||||||
def __init__(self, logger, level=logging.DEBUG):
|
|
||||||
self.logger = logger
|
|
||||||
self.level = level
|
|
||||||
|
|
||||||
def write(self, msg):
|
|
||||||
self.logger.log(self.level, msg.strip("\n"))
|
|
||||||
|
|
||||||
|
|
||||||
def run_server(application, port):
|
def run_server(application, port):
|
||||||
"""Run a WSGI server with the given application."""
|
"""Run a WSGI server with the given application."""
|
||||||
sock = eventlet.listen(('0.0.0.0', port))
|
sock = eventlet.listen(('0.0.0.0', port))
|
||||||
@ -79,7 +66,7 @@ class Server(object):
|
|||||||
"""Start a WSGI server in a new green thread."""
|
"""Start a WSGI server in a new green thread."""
|
||||||
logger = logging.getLogger('eventlet.wsgi.server')
|
logger = logging.getLogger('eventlet.wsgi.server')
|
||||||
eventlet.wsgi.server(socket, application, custom_pool=self.pool,
|
eventlet.wsgi.server(socket, application, custom_pool=self.pool,
|
||||||
log=WritableLogger(logger))
|
log=logging.WritableLogger(logger))
|
||||||
|
|
||||||
|
|
||||||
class Middleware(object):
|
class Middleware(object):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user