From a36652067041ebd5e21549cf5a3e2cd7fa921396 Mon Sep 17 00:00:00 2001 From: Jarrod Johnon Date: Wed, 21 Jan 2015 14:22:53 -0500 Subject: [PATCH] Fix circular import problem The change to allow configmanager to log traces erroneously broke due to use of 'import .. as' in circular imports. Skip 'as' and the problem does not occur. --- confluent_server/confluent/config/configmanager.py | 4 ++-- confluent_server/confluent/log.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/confluent_server/confluent/config/configmanager.py b/confluent_server/confluent/config/configmanager.py index 072d1351..8e0f7565 100644 --- a/confluent_server/confluent/config/configmanager.py +++ b/confluent_server/confluent/config/configmanager.py @@ -65,7 +65,7 @@ import anydbm as dbm import ast import base64 import confluent.config.attributes as allattributes -import confluent.log as log +import confluent.log import confluent.util import copy import cPickle @@ -925,7 +925,7 @@ class ConfigManager(object): except Exception: global tracelog if tracelog is None: - tracelog = log.Logger('trace') + tracelog = confluent.log.Logger('trace') tracelog.log(traceback.format_exc(), ltype=log.DataTypes.event, event=log.Events.stacktrace) diff --git a/confluent_server/confluent/log.py b/confluent_server/confluent/log.py index 7d6903c5..5e15dd76 100644 --- a/confluent_server/confluent/log.py +++ b/confluent_server/confluent/log.py @@ -60,7 +60,7 @@ # or other fields) import collections -import confluent.config.configmanager as configuration +import confluent.config.configmanager import eventlet import fcntl import json @@ -120,7 +120,7 @@ class Logger(object): # we are just a copy of the same object return self.initialized = True - self.filepath = configuration.get_global("logdirectory") + self.filepath = confluent.config.configmanager.get_global("logdirectory") if self.filepath is None: self.filepath = "/var/log/confluent/" self.isconsole = console