summaryrefslogtreecommitdiffstats
path: root/openstack
diff options
context:
space:
mode:
authorChuck Short <chuck.short@canonical.com>2013-07-12 15:48:57 -0400
committerChuck Short <chuck.short@canonical.com>2013-07-23 10:19:41 -0400
commit3243cdfbe9bd7d7b96aa164ec58ee3bf8342eb17 (patch)
tree0529318be2e5dc264c1d499dbaf9eaaee5435990 /openstack
parentca0ca29e3f04ced20f62c33ad8b5bf7492775824 (diff)
downloadoslo-3243cdfbe9bd7d7b96aa164ec58ee3bf8342eb17.tar.gz
oslo-3243cdfbe9bd7d7b96aa164ec58ee3bf8342eb17.tar.xz
oslo-3243cdfbe9bd7d7b96aa164ec58ee3bf8342eb17.zip
python3: handle module moves in log
Python 3 reorganized the standard library and moved several functions to different modules. Six provides a consistent interface to them through the fake six.moves module. Change-Id: I040fe8e0e4640e7cdd805ab49891b94da6cc4595 Signed-off-by: Chuck Short <chuck.short@canonical.com>
Diffstat (limited to 'openstack')
-rw-r--r--openstack/common/log.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/openstack/common/log.py b/openstack/common/log.py
index 465886b..c7e729c 100644
--- a/openstack/common/log.py
+++ b/openstack/common/log.py
@@ -29,8 +29,6 @@ It also allows setting of formatting information through conf.
"""
-import ConfigParser
-import cStringIO
import inspect
import itertools
import logging
@@ -41,6 +39,7 @@ import sys
import traceback
from oslo.config import cfg
+from six import moves
from openstack.common.gettextutils import _ # noqa
from openstack.common import importutils
@@ -348,7 +347,7 @@ class LogConfigError(Exception):
def _load_log_config(log_config):
try:
logging.config.fileConfig(log_config)
- except ConfigParser.Error as exc:
+ except moves.configparser.Error as exc:
raise LogConfigError(log_config, str(exc))
@@ -521,7 +520,7 @@ class ContextFormatter(logging.Formatter):
if not record:
return logging.Formatter.formatException(self, exc_info)
- stringbuffer = cStringIO.StringIO()
+ stringbuffer = moves.StringIO()
traceback.print_exception(exc_info[0], exc_info[1], exc_info[2],
None, stringbuffer)
lines = stringbuffer.getvalue().split('\n')