summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSol Jerome <sol.jerome@gmail.com>2011-05-09 15:20:11 -0500
committerSol Jerome <sol.jerome@gmail.com>2011-06-14 12:36:45 -0500
commitffce8cbd14a0ddc2cd266d80d63b36a786c08cb0 (patch)
tree6e65068ef2d899f7211ba8e137c3cb0c6a2590fe /src
parent382d96a8146a888c6edca7a20ee6cb348b202c4b (diff)
downloadbcfg2-ffce8cbd14a0ddc2cd266d80d63b36a786c08cb0.tar.gz
bcfg2-ffce8cbd14a0ddc2cd266d80d63b36a786c08cb0.tar.bz2
bcfg2-ffce8cbd14a0ddc2cd266d80d63b36a786c08cb0.zip
Logger: Statement always was True in python 2
Signed-off-by: Sol Jerome <sol.jerome@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/lib/Logger.py25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/lib/Logger.py b/src/lib/Logger.py
index 0a72e038c..8920ba747 100644
--- a/src/lib/Logger.py
+++ b/src/lib/Logger.py
@@ -12,8 +12,6 @@ import sys
import termios
# Compatibility import
from Bcfg2.Bcfg2Py3k import fprint
-if sys.hexversion >= 0x03000000:
- str = bytes
logging.raiseExceptions = 0
@@ -120,19 +118,16 @@ class FragmentingSysLogHandler(logging.handlers.SysLogHandler):
def emit(self, record):
"""Chunk and deliver records."""
record.name = self.procname
- if str(record.msg) > 250:
- msgs = []
- error = record.exc_info
- record.exc_info = None
- msgdata = record.msg
- while msgdata:
- newrec = copy.deepcopy(record)
- newrec.msg = msgdata[:250]
- msgs.append(newrec)
- msgdata = msgdata[250:]
- msgs[0].exc_info = error
- else:
- msgs = [record]
+ msgs = []
+ error = record.exc_info
+ record.exc_info = None
+ msgdata = record.msg
+ while msgdata:
+ newrec = copy.deepcopy(record)
+ newrec.msg = msgdata[:250]
+ msgs.append(newrec)
+ msgdata = msgdata[250:]
+ msgs[0].exc_info = error
for newrec in msgs:
msg = self.log_format_string % (self.encodePriority(self.facility,
newrec.levelname.lower()),