From: Loic Dachary Date: Tue, 21 Jul 2015 14:37:47 +0000 (+0200) Subject: ansible: decode('utf-8', 'ignore') before logging X-Git-Tag: 1.1.0~867^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F578%2Fhead;p=teuthology.git ansible: decode('utf-8', 'ignore') before logging b834dd6660a77379b2c693a36487352941a8e52d added decode('utf-8') which breaks when a substring inadevertendly cuts in the middle of a valid utf-8 sequence. Add the 'ignore' so the offending sequence is discarded instead of raising an error. Signed-off-by: Loic Dachary --- diff --git a/teuthology/task/ansible.py b/teuthology/task/ansible.py index ba792496..43071bb3 100644 --- a/teuthology/task/ansible.py +++ b/teuthology/task/ansible.py @@ -29,7 +29,7 @@ class LoggerFile(object): self.level = level def write(self, string): - self.logger.log(self.level, string.decode('utf-8')) + self.logger.log(self.level, string.decode('utf-8', 'ignore')) def flush(self): pass