diff --git a/openstack/common/log.py b/openstack/common/log.py index f9f226b8..5a4c310d 100644 --- a/openstack/common/log.py +++ b/openstack/common/log.py @@ -349,7 +349,7 @@ class JSONFormatter(logging.Formatter): def formatException(self, ei, strip_newlines=True): lines = traceback.format_exception(*ei) if strip_newlines: - lines = [itertools.ifilter( + lines = [moves.filter( lambda x: x, line.rstrip().splitlines()) for line in lines] lines = list(itertools.chain(*lines)) diff --git a/tests/unit/test_local.py b/tests/unit/test_local.py index 9310a51f..b5997798 100644 --- a/tests/unit/test_local.py +++ b/tests/unit/test_local.py @@ -15,6 +15,8 @@ import threading +from six import moves + from openstack.common import local from openstack.common import test @@ -36,7 +38,7 @@ class LocalStoreTestCase(test.BaseTestCase): # testing in (eventlet vs normal python threading) so # we test the correct type of local store for the current # threading model - reload(local) + moves.reload_module(local) def test_thread_unique_storage(self): """Make sure local store holds thread specific values."""