Fix logs encoding in py3

Make sure that logs are encoded as text (not byte strings) in
python3 to allow theirs serialization in JSON.

Closes-Bug: #1668533

Change-Id: I3d0d87ca766146457d905f89c26331a415bd54f8
This commit is contained in:
zackchen
2017-02-28 17:55:26 +08:00
parent 9b77ba530a
commit 000eaa3554
3 changed files with 9 additions and 1 deletions

@ -383,7 +383,7 @@ def gzip_and_b64encode(io_dict=None, file_list=None):
tar.add(f)
fp.seek(0)
return base64.encode_as_bytes(fp.getvalue())
return base64.encode_as_text(fp.getvalue())
def collect_system_logs(journald_max_lines=None):