]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
ansible: decode('utf-8', 'ignore') before logging 578/head
authorLoic Dachary <ldachary@redhat.com>
Tue, 21 Jul 2015 14:37:47 +0000 (16:37 +0200)
committerLoic Dachary <ldachary@redhat.com>
Tue, 21 Jul 2015 14:37:47 +0000 (16:37 +0200)
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 <loic@dachary.org>
teuthology/task/ansible.py

index ba792496a0c483f4fc9cc42495029d45ec62c5c9..43071bb30d4e71cec2dbef06fb28c3b79a3bb5d9 100644 (file)
@@ -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